diff --git a/simple-sql-parser.cabal b/simple-sql-parser.cabal index fa8ea32..824ce79 100644 --- a/simple-sql-parser.cabal +++ b/simple-sql-parser.cabal @@ -63,7 +63,6 @@ Test-Suite Tests Language.SQL.SimpleSQL.Postgres, Language.SQL.SimpleSQL.QueryExprComponents, Language.SQL.SimpleSQL.QueryExprs, - Language.SQL.SimpleSQL.SQL2003, Language.SQL.SimpleSQL.SQL2011, Language.SQL.SimpleSQL.TableRefs, Language.SQL.SimpleSQL.TestTypes, diff --git a/tools/Language/SQL/SimpleSQL/SQL2003.lhs b/tools/Language/SQL/SimpleSQL/SQL2003.lhs deleted file mode 100644 index fcb2f51..0000000 --- a/tools/Language/SQL/SimpleSQL/SQL2003.lhs +++ /dev/null @@ -1,3249 +0,0 @@ - -This file goes through the grammar from SQL 2003. The grammar is taken -from this site: http://savage.net.au/SQL/. - -We are only interested in the query syntax, goes through sections 5-10 -(section 9 has no syntax so isn't covered here). - -The goal is to create some coverage tests to get close to supporting a -large amount of the SQL. - -> module Language.SQL.SimpleSQL.SQL2003 (sql2003Tests) where - -> import Language.SQL.SimpleSQL.TestTypes -> import Language.SQL.SimpleSQL.Syntax - -> sql2003Tests :: TestItem -> sql2003Tests = Group "sql2003Tests" -> [Group "literals" [ -> stringLiterals -> ,nationalCharacterStringLiterals -> ,unicodeStringLiterals -> ,binaryStringLiterals -> ,numericLiterals -> ,intervalLiterals -> ,booleanLiterals -> ,identifiers -> ],Group "value expressions" -> [typeNameTests -> ,parenthesizedValueExpression -> ,someGeneralValues -> ,targetSpecification -> ,contextuallyTypeValueSpec -> ,moduleColumnRef -> ,groupingOperation -> --,windowFunction -> --,caseExpression -> --,castSpecification -> ,nextValueExpression -> -- subtype treatment, method invoc, static m i, new spec, attrib/method ref, deref, method ref, ref res -> ,arrayElementReference -> ,multisetElementReference -> ,numericValueExpression -> --,numericValueFunction -> --,stringValueExpression -> --,stringValueFunction -> --,datetimeValueExpression -> --,datetimeValueFunction -> --,intervalValueExpression -> --,intervalValueFunction -> --,booleanValueExpression -> --arrayValueExpression -> ,arrayValueConstructor -> ,multisetValueExpression -> ,multisetValueFunction -> ,multisetValueConstructor -> ],Group "query expressions" -> [ -> -- rowValueConstructor -> --,rowValueExpression -> --,tableValueConstructor -> --,fromClause -> --,joinedTable -> --,whereClause -> groupbyClause -> --,havingClause -> --,windowClause -> --,querySpecification -> --,querySpecifications -> --,setOperations -> --,withExpressions -> ],Group "predicates" -> [--comparisonPredicate -> --,betweenPredicate -> --,inPredicate -> --,likePredicate -> --,similarPredicae -> --,nullPredicate -> quantifiedComparisonPredicate -> --,existsPredicate -> ,uniquePredicate -> --,normalizedPredicate -> ,matchPredicate -> --,overlapsPredicate -> --,distinctPredicate -> --,memberPredicate -> --,submultisetPredicate -> --,setPredicate -> ,collateClause -> ,aggregateFunctions -> ,sortSpecificationList -> ] -> ] - -= 5 Lexical Elements - -Basic definitions of characters used, tokens, symbols, etc. Most of this section would normally be handled within the lexical analyzer rather than in the grammar proper. Further, the original document does not quote the various single characters, which makes it hard to process automatically. - -[There seems to be a lot of unused stuff here, so skip this section -and only do bits which are needed by other bits] - -5.1 (p151) - - ::= - - ::= | | - - ::= | - - ::= - A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z - - ::= - a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z - - ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 - - ::= - - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - - ::= !! See the Syntax Rules. - - ::= " - - ::= % - - ::= & - - ::= ' - - ::= ( - - ::= ) - - ::= * - - ::= + - - ::= , - - ::= - - - ::= . - - ::= / - - ::= : - - ::= ; - - ::= < - - ::= = - - ::= > - - ::= ? - -The trigraphs are new in SQL-2003. - - ::= | - - ::= | - - ::= [ - - ::= ??( - - ::= ] - - ::= ??) - - ::= ^ - - ::= _ - - ::= /* Nothing */ | - - ::= { - - ::= } - - - -5.2 and (p134) - -Specifying lexical units (tokens and separators) that participate in SQL language. - - ::= | - - ::= - - | - | - | - | - | - | - | - - ::= - - ::= [ ... ] - - ::= | - -Previous standard said: - - ::= | - - ::= !! See the Syntax Rules. - - ::= !! See the Syntax Rules. - - ::= ... - - ::= K | M | G - - ::= - - ::= ... - - ::= | - -The productions for and so on are new in SQL-2003. - - ::= - U - - - ::= [ UESCAPE ] - - ::= ... - - ::= | - - ::= - - | - | - -Syntax rule 20: '+xyzw' is equivalent to the Unicode code point specified by U+xyzw. - - ::= - -Syntax rule 21: '+xyzwrs' is equivalent to the Unicode code point specified by U+xyzwrs. - -NOTE 64: The 6-hexit notation is derived by taking the UCS-4 notation defined by ISO/IEC 10646-1 and removing the leading two hexits, whose values are always 0 (zero). - - ::= - - -Syntax rule 22: is equivalent to a single instance of . - - ::= - -Syntax rule 15: shall be a single character from the source language character set other than a , , or . - -Syntax rule 16: If the source language character set contains , then let DEC be ; otherwise, let DEC be an implementation-defined character from the source language character set that is not a , , , or . - -Syntax rule 17: If a does not contain , then "UESCAPE DEC" is implicit. - -Syntax rule 18: In a there shall be no between the and the first , nor between any of the s. - - ::= !! See the Syntax Rules (15-18 above). - -Syntax rule 6: A is any character of the source language character set other than a . - - ::= !! See the Syntax Rules. - -The rule for in the standard uses two adjacent literal double quotes rather than referencing ; the reasons are not clear. It is annotated '!! two consecutive double quote characters'. - -TODO: unicode delimited identifier - - ::= - - ::= - - | - |