From: <el...@us...> - 2008-07-22 10:59:46
|
Revision: 8048 http://exist.svn.sourceforge.net/exist/?rev=8048&view=rev Author: ellefj Date: 2008-07-22 10:59:41 +0000 (Tue, 22 Jul 2008) Log Message: ----------- [ignore] antlr3-branch Doing some more cleaning up. Still some errors due to antlr3 bugs. Modified Paths: -------------- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtTreeParser.g branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtTreeParser.tokens branches/ljo/antlr3/src/org/exist/xquery/parser/XML.tokens branches/ljo/antlr3/src/org/exist/xquery/parser/XQuery.g branches/ljo/antlr3/src/org/exist/xquery/parser/XQuery.tokens branches/ljo/antlr3/src/org/exist/xquery/parser/XQueryLexer.java branches/ljo/antlr3/src/org/exist/xquery/parser/XQueryParser.java branches/ljo/antlr3/src/org/exist/xquery/parser/XQueryTreeParser.g branches/ljo/antlr3/src/org/exist/xquery/parser/XQueryTreeParser.java branches/ljo/antlr3/src/org/exist/xquery/parser/XQueryTreeParser.tokens branches/ljo/antlr3/src/org/exist/xquery/parser/XQueryTreeParser_FullTextExtTreeParser.java branches/ljo/antlr3/src/org/exist/xquery/parser/XQuery_FullTextExt.java branches/ljo/antlr3/src/org/exist/xquery/parser/XQuery_XML.java branches/ljo/antlr3/src/org/exist/xquery/parser/XQuery_XUpdateExt.java Added Paths: ----------- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.g branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.tokens branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.g branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.tokens branches/ljo/antlr3/src/org/exist/xquery/parser/XQUpdateExt.g branches/ljo/antlr3/src/org/exist/xquery/parser/XQUpdateExt.tokens Removed Paths: ------------- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.g branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.tokens branches/ljo/antlr3/src/org/exist/xquery/parser/XUpdateExt.g branches/ljo/antlr3/src/org/exist/xquery/parser/XUpdateExt.tokens Deleted: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.g =================================================================== --- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.g 2008-07-22 05:41:37 UTC (rev 8047) +++ branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.g 2008-07-22 10:59:41 UTC (rev 8048) @@ -1,224 +0,0 @@ -/* - * eXist Open Source Native XML Database - * Copyright (C) 2007-2008 The eXist Project - * http://exist-db.org - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $Id$ - */ -parser grammar FullTextExt; - -@header { -package org.exist.xquery.parser; -} - -ftOptionDecl -throws XPathException -: - decl=DECLARE! ftopt=FT_OPTION! ftMatchOption - ; - -ftScoreVar -: - SCORE DOLLAR varName=qName - -> ^(FTSCORE_VAR $varName) - ; - -ftContainsExpr - : - rangeExpr ( - FTCONTAINS^ ftSelection - ( ftIgnoreOption )? - )? - ; - -ftSelection throws XPathException -: - ftOr ( ( ftMatchOption | ftProximity )* ( WEIGHT^ rangeExpr )? ) - ; - -ftOr throws XPathException -: - ftAnd ( OROR^ ftAnd )* - ; - -ftAnd throws XPathException -: - ftMildNot ( ANDAND^ ftMildNot )* - ; - -ftMildNot throws XPathException -: - ftUnaryNot ( MILD^ NOT^ ftUnaryNot )* - ; - -ftUnaryNot throws XPathException -: - (BANG^)? ftWordSelection - ; - -ftWordSelection throws XPathException -: - ( ftWords ( ftTimes )? ) - | ( LPAREN! ftSelection RPAREN! ) - ; - -ftWords throws XPathException -: - ftWordsValue ( ftAnyallOption )? - ; - -ftWordsValue throws XPathException -: - literal | ( LCURLY! expr RCURLY! ) - ; - -ftAnyallOption throws XPathException -: - ( ANY^ ( WORD^ )? ) - | ( ALL^ ( WORD^ )? ) - | ( PHRASE^ ) - ; - -ftProximity throws XPathException -: - ftOrderedIndicator | ftWindow | ftDistance | ftScope | ftContent - ; - -ftOrderedIndicator throws XPathException -: - ORDERED^ - ; - -ftMatchOption throws XPathException -: - ftCaseOption - | ftDiacriticsOption - | ftLanguageOption - | ( WITH^ ( ftOnlyDiacriticsOption | ftStemOption | ftWildCardOption | ftWithThesaurusOption | ftWithStopWordOption ) - | WITHOUT^ ( ftOnlyDiacriticsOption | ftStemOption | ftWildCardOption | ( THESAURUS^ ) | ( STOP^ WORDS^ ) ) - ) - ; - -ftCaseOption throws XPathException -: - LOWERCASE^ - | UPPERCASE^ - | CASE^ ( SENSITIVE^ | INSENSITIVE^ ) - ; - -ftOnlyDiacriticsOption throws XPathException -: - DIACRITICS^ - ; - -ftDiacriticsOption throws XPathException -: - DIACRITICS^ - ( SENSITIVE^ | INSENSITIVE^ ) - ; - -ftStemOption throws XPathException -: - ( STEMMING ) - ; - -ftWithThesaurusOption throws XPathException -: - ( THESAURUS^ ( ftThesaurusID | DEFAULT ) ) - | ( THESAURUS^ LPAREN! ( ftThesaurusID | DEFAULT ) ( COMMA! ftThesaurusID )* RPAREN! ) - ; - -ftThesaurusID throws XPathException -: - AT^ STRING_LITERAL^ ( RELATIONSHIP^ STRING_LITERAL^ )? ( ftRange LEVELS^ )? - ; - -ftWithStopWordOption throws XPathException -: - ( ( STOP^ WORDS^ ftRefOrList ) | ( DEFAULT^ STOP^ WORDS^ ) ) - ( ftInclExclStringLiteral )* - ; - -ftRefOrList throws XPathException -: - ( AT^ STRING_LITERAL^ ) - | ( LPAREN! STRING_LITERAL^ ( COMMA! STRING_LITERAL^ )* RPAREN! ) - ; - -ftInclExclStringLiteral throws XPathException -: - ( UNION^ | EXCEPT^ ) ftRefOrList - ; - -ftLanguageOption throws XPathException -: - LANGUAGE^ STRING_LITERAL^ - ; - -ftWildCardOption throws XPathException -: - ( WILDCARDS^ ) - ; - -ftContent throws XPathException -: - ( AT^ ( START^ | END^ ) ) - | ( ENTIRE^ CONTENT^ ) - ; - -ftRange throws XPathException -: - ( EXACTLY^ unionExpr ) - | ( AT^ ( LEAST^ | MOST^ ) unionExpr ) - | ( FROM^ unionExpr TO^ unionExpr ) - ; - -ftDistance throws XPathException -: - DISTANCE^ ftRange ftUnit - ; - -ftWindow throws XPathException -: - WINDOW^ ftRange ftUnit - ; - -ftTimes throws XPathException -: - OCCURS^ ftRange TIMES^ - ; - -ftScope throws XPathException -: - ( SAME^ | DIFFERENT^ ) ftBigUnit - ; - -ftUnit throws XPathException -: - WORDS^ | SENTENCES^ | PARAGRAPHS^ - ; - -ftBigUnit throws XPathException -: - SENTENCE^ | PARAGRAPH^ - ; - -ftIgnoreOption throws XPathException -: - WITHOUT^ CONTENT^ unionExpr - ; - Deleted: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.tokens =================================================================== --- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.tokens 2008-07-22 05:41:37 UTC (rev 8047) +++ branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.tokens 2008-07-22 10:59:41 UTC (rev 8048) @@ -1,867 +0,0 @@ -FUNCTION=12 -PREFIX_WILDCARD=11 -EXCEPT=825 -DISTANCE=837 -RPAREN=50 -STRING_LITERAL=106 -XML_CDATA_END=130 -PRECEDING=159 -WORDS=813 -PARENTHESIZED=7 -RETURN=64 -XML_PI=121 -ELEMENT=19 -EXPR_COMMENT=127 -EQ=53 -NAMESPACE_DECL=24 -LE_ATOM=83 -STRICT=198 -PRESERVE=180 -TYPESWITCH=186 -STOP=812 -CONTENT=831 -VALUE=191 -EMPTY=161 -INTERSECT=915 -GROUP=173 -SCHEMA_ELEMENT=922 -NO_PRESERVE=852 -GT=87 -LTEQ=90 -THESAURUS=811 -VERSION=162 -DESCENDANTORSELF=154 -ASCENDING=911 -TO_OP=143 -AT=129 -AS=59 -CONSTRUCTION=183 -DOCUMENT=149 -COMP_ELEM_CONSTRUCTOR=41 -PLUS=62 -CASTABLE=76 -BY=172 -ELEMENT_CONTENT=118 -INHERIT=201 -ANCESTOR_OR_SELF=918 -QUOT=112 -POSITIONAL_VAR=36 -MINUS=95 -MODULE=33 -ORDERED=184 -SAME=841 -VARIABLE_BINDING=18 -COLON=58 -INSTANCE=73 -WILDCARDS=827 -DEF_FUNCTION_NS_DECL=27 -RCURLY=57 -NOINHERIT=202 -DESCENDING=912 -SCHEMA_IMPORT=39 -SELF=128 -XML_COMMENT_END=120 -LT=89 -T__375=375 -T__569=569 -T__374=374 -T__568=568 -T__373=373 -T__567=567 -T__372=372 -T__566=566 -T__371=371 -T__565=565 -T__370=370 -T__574=574 -CHAR=206 -T__575=575 -DIFFERENT=842 -T__572=572 -T__573=573 -T__570=570 -T__369=369 -T__571=571 -T__367=367 -T__368=368 -PARENT_ABREV=205 -T__386=386 -T__388=388 -T__387=387 -T__577=577 -T__576=576 -T__579=579 -T__578=578 -T__583=583 -XML_CDATA=123 -T__580=580 -T__581=581 -T__582=582 -COMMENT=148 -INTO=194 -T__498=498 -T__497=497 -NO_INHERIT=853 -T__496=496 -BOUNDARYSPACE=179 -T__495=495 -T__391=391 -T__494=494 -T__390=390 -T__493=493 -T__492=492 -T__687=687 -T__491=491 -T__686=686 -T__395=395 -T__490=490 -T__394=394 -OROR=220 -T__393=393 -T__392=392 -T__399=399 -WITHOUT=810 -T__398=398 -T__397=397 -T__396=396 -EVERY=175 -T__389=389 -SENSITIVE=816 -T__596=596 -WEIGHT=796 -T__597=597 -DELETE=190 -T__594=594 -T__595=595 -OF=74 -EXTENDER=141 -T__698=698 -T__699=699 -T__599=599 -DESCENDANT_OR_SELF=916 -T__598=598 -COMP_COMMENT_CONSTRUCTOR=44 -DEF_NAMESPACE_DECL=25 -XML_PI_END=122 -T__499=499 -ESCAPE_APOS=117 -ATTRIBUTE_CONTENT=21 -WHERE=63 -LAX=197 -T__471=471 -T__472=472 -EQ_ATOM=80 -T__470=470 -T__475=475 -T__476=476 -T__473=473 -PRAGMA=48 -T__474=474 -ESCAPE_QUOT=115 -T__469=469 -T__468=468 -T__467=467 -T__466=466 -IF=68 -T__341=341 -T__342=342 -FLWOR=6 -T__343=343 -T__344=344 -IN=67 -T__340=340 -COMMA=54 -IS=91 -WILDCARD=10 -SOME=174 -EXCEPT_OP=170 -T__478=478 -T__477=477 -T__479=479 -COLLECTION=151 -DIGIT=136 -T__339=339 -T__338=338 -T__335=335 -T__334=334 -T__337=337 -WITH=193 -T__336=336 -T__350=350 -T__351=351 -T__354=354 -CHAR_REF=204 -T__355=355 -T__352=352 -T__353=353 -XQUERY=163 -T__453=453 -IDIV_OP=914 -T__454=454 -EXACTLY=832 -T__451=451 -T__452=452 -T__450=450 -DEFAULT=166 -DESCENDANT=153 -T__449=449 -T__448=448 -T__447=447 -BANG=222 -T__446=446 -T__445=445 -T__444=444 -T__348=348 -T__347=347 -T__346=346 -T__345=345 -PHRASE=809 -END_TAG_START=111 -T__349=349 -T__360=360 -T__361=361 -T__362=362 -NMSTART=139 -NEQ=86 -T__363=363 -T__364=364 -QUESTION=60 -T__365=365 -T__366=366 -T__462=462 -T__463=463 -T__464=464 -T__465=465 -XPOINTER=15 -T__460=460 -T__461=461 -T__459=459 -LEAST=833 -WINDOW=838 -T__456=456 -T__455=455 -ISNOT=92 -T__458=458 -T__457=457 -PARAGRAPHS=844 -T__357=357 -T__356=356 -ANCESTORORSELF=155 -T__359=359 -T__358=358 -LET=66 -MODULE_DECL=37 -APOS=113 -STAR=61 -T__439=439 -DIV_OP=144 -T__259=259 -INTERSECTION_OP=169 -LETTER=135 -APOS_ATTRIBUTE_CONTENT=116 -T__258=258 -T__438=438 -T__257=257 -T__443=443 -T__262=262 -T__442=442 -T__263=263 -T__441=441 -T__260=260 -T__635=635 -T__440=440 -T__261=261 -T__634=634 -T__266=266 -T__633=633 -T__267=267 -NOT=800 -T__632=632 -T__264=264 -T__631=631 -T__265=265 -T__300=300 -UNARY_PLUS=14 -RPPAREN=103 -IMPORT=176 -T__247=247 -T__426=426 -SENTENCE=845 -T__246=246 -T__427=427 -T__249=249 -T__630=630 -T__248=248 -T__422=422 -T__423=423 -T__424=424 -GE_ATOM=85 -T__425=425 -T__625=625 -T__624=624 -T__250=250 -T__627=627 -T__251=251 -T__626=626 -T__252=252 -T__621=621 -T__253=253 -T__620=620 -T__254=254 -T__623=623 -T__255=255 -T__622=622 -T__256=256 -UNION_OP=168 -DIACRITICS=818 -T__629=629 -T__628=628 -CHILD=147 -T__318=318 -T__520=520 -OR_OP=71 -T__319=319 -T__419=419 -T__316=316 -T__317=317 -T__314=314 -T__315=315 -T__312=312 -T__313=313 -T__413=413 -NMCHAR=142 -T__414=414 -T__411=411 -T__412=412 -T__417=417 -T__418=418 -ELSE=70 -SELF_ABREV=110 -T__415=415 -T__416=416 -T__704=704 -T__612=612 -T__288=288 -T__703=703 -T__611=611 -T__289=289 -T__702=702 -T__610=610 -T__286=286 -T__701=701 -LCURLY=56 -UNARY_MINUS=13 -T__287=287 -T__700=700 -T__616=616 -T__421=421 -SEMICOLON=52 -T__284=284 -T__615=615 -T__420=420 -T__285=285 -T__614=614 -T__519=519 -T__282=282 -T__613=613 -T__518=518 -COMP_TEXT_CONSTRUCTOR=43 -T__283=283 -T__517=517 -T__322=322 -T__619=619 -T__516=516 -T__281=281 -T__321=321 -T__618=618 -T__515=515 -T__320=320 -T__709=709 -T__617=617 -T__514=514 -T__708=708 -T__513=513 -T__707=707 -T__512=512 -NE_ATOM=81 -T__706=706 -T__511=511 -T__705=705 -T__510=510 -T__305=305 -T__408=408 -COMP_PI_CONSTRUCTOR=45 -T__306=306 -T__409=409 -NCNAME=51 -T__307=307 -T__308=308 -LANGUAGE=826 -QNAME=4 -WS=126 -T__301=301 -T__302=302 -LOWERCASE=814 -T__303=303 -T__304=304 -T__400=400 -INSENSITIVE=817 -T__401=401 -T__402=402 -T__403=403 -FT_OPTION=792 -T__269=269 -T__309=309 -T__404=404 -T__268=268 -T__405=405 -T__406=406 -T__407=407 -T__713=713 -T__712=712 -T__715=715 -T__601=601 -T__714=714 -T__600=600 -T__508=508 -T__603=603 -FUNCTION_DECL=29 -T__602=602 -T__507=507 -T__711=711 -T__605=605 -T__410=410 -T__710=710 -T__604=604 -T__509=509 -END=829 -T__607=607 -T__504=504 -T__606=606 -T__503=503 -DSLASH=101 -T__609=609 -T__506=506 -T__311=311 -T__608=608 -T__505=505 -T__270=270 -DECIMAL_LITERAL=108 -T__310=310 -T__717=717 -T__500=500 -T__716=716 -T__719=719 -T__502=502 -T__718=718 -T__501=501 -RENAME=195 -T__215=215 -T__685=685 -T__216=216 -T__684=684 -T__213=213 -T__683=683 -T__214=214 -T__682=682 -OPTION=31 -T__681=681 -T__680=680 -BOUNDARY_SPACE=849 -T__217=217 -T__218=218 -T__542=542 -LPPAREN=102 -OCCURS=839 -SATISFIES=913 -T__679=679 -PREDICATE=5 -T__677=677 -LPAREN=49 -T__678=678 -ANDAND=221 -T__675=675 -XML_PI_START=125 -T__676=676 -T__672=672 -EMPTY_SEQUENCE=854 -T__671=671 -PARENT=105 -T__674=674 -COMP_ATTR_CONSTRUCTOR=42 -T__673=673 -SLASH=100 -T__207=207 -THEN=69 -T__208=208 -T__670=670 -T__209=209 -COLLATION=178 -REPLACE=189 -T__531=531 -T__530=530 -ANCESTOR=152 -T__521=521 -T__522=522 -ABSOLUTE_SLASH=8 -T__523=523 -T__524=524 -T__525=525 -T__526=526 -T__527=527 -T__528=528 -T__529=529 -T__668=668 -T__669=669 -T__210=210 -T__664=664 -MOST=834 -PRAGMA_START=97 -T__665=665 -T__212=212 -T__666=666 -T__211=211 -T__667=667 -LT_ATOM=82 -T__239=239 -PRECEDINGSIBLING=156 -T__237=237 -T__663=663 -T__238=238 -T__662=662 -T__235=235 -T__661=661 -ITEM=160 -T__236=236 -T__660=660 -TO=836 -T__564=564 -T__563=563 -ATOMIC_TYPE=32 -T__562=562 -T__561=561 -T__560=560 -STEMMING=819 -T__558=558 -T__559=559 -T__556=556 -T__557=557 -T__554=554 -TEXT=22 -T__555=555 -T__245=245 -T__655=655 -T__244=244 -T__656=656 -T__243=243 -T__653=653 -T__242=242 -T__654=654 -UNION=99 -T__241=241 -T__659=659 -T__240=240 -T__657=657 -T__658=658 -FOLLOWING_SIBLING=917 -T__229=229 -GROUP_BY=35 -SCHEMA=199 -T__650=650 -T__652=652 -T__651=651 -T__551=551 -T__550=550 -ENTIRE=830 -T__553=553 -VALIDATE=96 -T__552=552 -T__547=547 -T__548=548 -START=828 -DECLARE=177 -T__549=549 -T__543=543 -MODULE_IMPORT=38 -T__544=544 -ATTRIBUTE_TEST=40 -T__545=545 -T__546=546 -T__232=232 -T__231=231 -T__234=234 -ORDER_BY=34 -T__233=233 -T__646=646 -T__647=647 -T__230=230 -T__648=648 -T__649=649 -SENTENCES=843 -CAST=77 -T__764=764 -T__763=763 -EXTERNAL=167 -T__766=766 -T__765=765 -T__768=768 -T__767=767 -BASECHAR=133 -T__769=769 -FOLLOWINGSIBLING=157 -XML_CDATA_START=132 -CASE=196 -ENCODING=187 -DOUBLE_LITERAL=107 -DOCUMENT_NODE=921 -T__770=770 -T__771=771 -T__772=772 -T__773=773 -WORD=807 -T__777=777 -T__776=776 -T__775=775 -T__774=774 -UPPERCASE=815 -INSERT=192 -T__779=779 -T__778=778 -ATTRIBUTE_ABREV=104 -IDEOGRAPHIC=134 -T__780=780 -PRAGMA_END=98 -T__783=783 -T__784=784 -T__781=781 -T__782=782 -T__789=789 -T__786=786 -T__785=785 -NODE=146 -T__788=788 -T__787=787 -PREDEFINED_ENTITY_REF=203 -GREATEST=848 -VARIABLE_REF=17 -PROCESSING_INSTRUCTION=920 -COMP_NS_CONSTRUCTOR=46 -RELATIONSHIP=822 -NAMESPACE=165 -T__790=790 -T__791=791 -AND_OP=72 -FTSCORE_VAR=333 -VARIABLE=164 -BASE_URI=850 -INTEGER_LITERAL=109 -NOPRESERVE=200 -ANDEQ=93 -PROLOG=30 -QUOT_ATTRIBUTE_CONTENT=114 -FROM=835 -PRECEDING_SIBLING=919 -GLOBAL_VAR=28 -T__727=727 -DOLLAR=55 -T__728=728 -T__729=729 -T__720=720 -ORDER=171 -T__721=721 -T__722=722 -T__723=723 -DIGITS=137 -T__724=724 -MILD=799 -T__725=725 -XPOINTER_ID=16 -T__726=726 -ATTRIBUTE=20 -UPDATE=124 -FOR=65 -ABSOLUTE_DSLASH=9 -FOLLOWING=158 -FTCONTAINS=795 -NEXT_TOKEN=131 -T__738=738 -T__739=739 -XML_COMMENT=119 -T__292=292 -T__291=291 -T__290=290 -PARAGRAPH=846 -COPY_NAMESPACES=851 -T__732=732 -T__296=296 -T__733=733 -T__295=295 -OREQ=94 -T__730=730 -T__294=294 -T__731=731 -T__293=293 -T__736=736 -ALL=808 -T__737=737 -T__299=299 -T__734=734 -T__298=298 -COMP_DOC_CONSTRUCTOR=47 -T__735=735 -T__297=297 -STRIP=181 -STABLE=910 -GT_ATOM=84 -T__751=751 -BEFORE=78 -T__750=750 -AFTER=79 -GTEQ=88 -BASEURI=188 -UNORDERED=185 -DEF_COLLATION_DECL=26 -ANY=806 -SCORE=793 -ORDERING=182 -T__758=758 -T__759=759 -T__756=756 -T__757=757 -T__754=754 -T__755=755 -T__752=752 -VERSION_DECL=23 -T__753=753 -COMBINING_CHAR=140 -DOCUMENTNODE=150 -T__762=762 -T__761=761 -HEX_DIGITS=138 -T__760=760 -TIMES=840 -LEVELS=823 -MOD_OP=145 -TREAT=75 -'end'=775 -'most'=780 -'text'=22 -'inherit'=201 -'diacritics'=768 -'no-preserve'=200 -'greatest'=207 -'lax'=197 -'distance'=782 -'with'=193 -'start'=774 -'preserve'=180 -'value'=191 -'parent'=105 -'document'=149 -'mild'=754 -'thesaurus'=761 -'ftcontains'=752 -'document-node'=150 -'ascending'=212 -'sentence'=790 -'different'=787 -'stable'=211 -'unordered'=185 -'all'=758 -'sentences'=788 -'descendant'=153 -'not'=755 -'entire'=776 -'stemming'=769 -'exactly'=778 -'default'=166 -'sensitive'=766 -'ordered'=184 -'update'=124 -'window'=783 -'version'=162 -'relationship'=770 -'paragraph'=791 -'div'=144 -'element'=19 -'module'=33 -'preceding-sibling'=156 -'word'=757 -'replace'=189 -'strip'=181 -'union'=168 -'variable'=164 -'copy-namespaces'=209 -'ancestor'=152 -'any'=756 -'case'=196 -'levels'=771 -'ancestor-or-self'=155 -'external'=167 -'lowercase'=764 -'no-inherit'=202 -'node'=146 -'into'=194 -'satisfies'=214 -'phrase'=759 -'stop'=762 -'schema'=199 -'typeswitch'=186 -'declare'=177 -'xquery'=163 -'intersect'=216 -'language'=772 -'strict'=198 -'descendant-or-self'=154 -'schema-element'=218 -'boundary-space'=179 -'insensitive'=767 -'base-uri'=188 -'insert'=192 -'least'=779 -'function'=12 -'delete'=190 -'some'=174 -'wildcards'=773 -'import'=176 -'paragraphs'=789 -'xpointer'=15 -'order'=171 -'option'=31 -'following-sibling'=157 -'child'=147 -'collation'=178 -'content'=777 -'ft-option'=750 -'empty'=161 -'every'=175 -'idiv'=215 -'mod'=145 -'words'=763 -'at'=129 -'processing-instruction'=217 -'construction'=183 -'group'=173 -'descending'=213 -'encoding'=187 -'times'=785 -'comment'=148 -'same'=786 -'item'=160 -'uppercase'=765 -'preceding'=159 -'rename'=195 -'by'=172 -'namespace'=165 -'empty-sequence'=210 -'weight'=753 -'following'=158 -'to'=143 -'occurs'=784 -'ordering'=182 -'without'=760 -'attribute'=20 -'self'=128 -'except'=170 -'score'=751 -'from'=781 Added: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.g =================================================================== --- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.g (rev 0) +++ branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.g 2008-07-22 10:59:41 UTC (rev 8048) @@ -0,0 +1,250 @@ +/* + * eXist Open Source Native XML Database + * Copyright (C) 2007-2008 The eXist Project + * http://exist-db.org + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $Id$ + */ + +lexer grammar FullTextExtLexer; + +@header { +package org.exist.xquery.parser; +} + + +// Lexer + +fragment ALL +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'all' ; + +fragment ANY +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'any' ; + +fragment BANG +@init { gParent.paraphrase.push("ft BANG"); } +@after { gParent.paraphrase.pop(); } +: '!' ; +fragment CONTENT +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'content' ; + +fragment DIACRITICS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'diacritics' ; + +fragment DIFFERENT +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'different' ; + +fragment DISTANCE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'distance' ; + +fragment END +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'end' ; + +fragment ENTIRE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'entire' ; + +fragment EXACTLY +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'exactly' ; + +fragment FROM +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'from' ; + +fragment FTAND +@init { gParent.paraphrase.push("ft AND"); } +@after { gParent.paraphrase.pop(); } +: '&&&' ; + +fragment FTOR +@init { gParent.paraphrase.push("ft OR"); } +@after { gParent.paraphrase.pop(); } +: '|||' ; + + +fragment FTCONTAINS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'contains' ; + +fragment FT_OPTION +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'ft-option' ; + +fragment INSENSITIVE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'insensitive' ; + +fragment LANGUAGE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'language' ; + +fragment LEVELS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'levels' ; + +fragment LOWERCASE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'lowercase' ; + +fragment MILD +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'mild' ; + +fragment MOST +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'most' ; + +fragment NOT +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'not' ; + +fragment OCCURS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'occurs' ; + +fragment PARAGRAPH +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'paragraph' ; + +fragment PARAGRAPHS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'paragraphs' ; + +fragment PHRASE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'phrase' ; + +fragment RELATIONSHIP +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'relationship' ; + +fragment SAME +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'same' ; + +fragment SCORE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'score' ; + +fragment SENSITIVE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'sensitive' ; + +fragment SENTENCE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'sentence' ; + +fragment SENTENCES +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'sentences' ; + +fragment START +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'start' ; + +fragment STEMMING +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'stemming' ; + +fragment STOP +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'stop' ; + +fragment THESAURUS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'thesaurus' ; + +fragment TIMES +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'times' ; + +fragment UPPERCASE +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'uppercase' ; + +fragment WEIGHT +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'weight' ; + +fragment WILDCARDS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'wildcards' ; + +fragment WINDOW +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'window' ; + +fragment WITHOUT +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'without' ; + +fragment WORD +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'word' ; + +fragment WORDS +@init { gParent.paraphrase.push("ft keyword"); } +@after { gParent.paraphrase.pop(); } +: 'words' ; Property changes on: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.g ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.tokens =================================================================== --- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.tokens (rev 0) +++ branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtLexer.tokens 2008-07-22 10:59:41 UTC (rev 8048) @@ -0,0 +1,870 @@ +FUNCTION=12 +PREFIX_WILDCARD=11 +EXCEPT=825 +DISTANCE=837 +RPAREN=50 +STRING_LITERAL=106 +XML_CDATA_END=130 +PRECEDING=159 +WORDS=813 +PARENTHESIZED=7 +RETURN=64 +XML_PI=121 +ELEMENT=19 +EXPR_COMMENT=127 +EQ=53 +NAMESPACE_DECL=24 +LE_ATOM=83 +STRICT=198 +PRESERVE=180 +TYPESWITCH=186 +STOP=812 +CONTENT=831 +VALUE=191 +EMPTY=161 +INTERSECT=915 +GROUP=173 +FTAND=929 +SCHEMA_ELEMENT=922 +NO_PRESERVE=852 +GT=87 +LTEQ=90 +THESAURUS=811 +VERSION=162 +DESCENDANTORSELF=154 +ASCENDING=911 +TO_OP=143 +AT=129 +AS=59 +CONSTRUCTION=183 +DOCUMENT=149 +COMP_ELEM_CONSTRUCTOR=41 +PLUS=62 +CASTABLE=76 +BY=172 +ELEMENT_CONTENT=118 +INHERIT=201 +ANCESTOR_OR_SELF=918 +QUOT=112 +POSITIONAL_VAR=36 +MINUS=95 +MODULE=33 +Tokens=930 +ORDERED=184 +SAME=841 +VARIABLE_BINDING=18 +COLON=58 +INSTANCE=73 +WILDCARDS=827 +DEF_FUNCTION_NS_DECL=27 +RCURLY=57 +NOINHERIT=202 +DESCENDING=912 +SCHEMA_IMPORT=39 +SELF=128 +XML_COMMENT_END=120 +LT=89 +T__375=375 +T__569=569 +T__374=374 +T__568=568 +T__373=373 +T__567=567 +T__372=372 +T__566=566 +T__371=371 +T__565=565 +T__370=370 +T__574=574 +CHAR=206 +T__575=575 +DIFFERENT=842 +T__572=572 +T__573=573 +T__570=570 +T__369=369 +T__571=571 +T__367=367 +T__368=368 +PARENT_ABREV=205 +T__386=386 +T__388=388 +T__387=387 +T__577=577 +T__576=576 +T__579=579 +T__578=578 +T__583=583 +XML_CDATA=123 +T__580=580 +T__581=581 +T__582=582 +COMMENT=148 +INTO=194 +T__498=498 +T__497=497 +NO_INHERIT=853 +T__496=496 +BOUNDARYSPACE=179 +T__495=495 +T__391=391 +T__494=494 +T__390=390 +T__493=493 +T__492=492 +T__687=687 +T__491=491 +T__686=686 +T__395=395 +T__490=490 +T__394=394 +OROR=220 +T__393=393 +T__392=392 +T__399=399 +WITHOUT=810 +T__398=398 +T__397=397 +T__396=396 +EVERY=175 +T__389=389 +SENSITIVE=816 +T__596=596 +WEIGHT=796 +T__597=597 +DELETE=190 +T__594=594 +T__595=595 +OF=74 +EXTENDER=141 +T__698=698 +T__699=699 +T__599=599 +DESCENDANT_OR_SELF=916 +T__598=598 +COMP_COMMENT_CONSTRUCTOR=44 +DEF_NAMESPACE_DECL=25 +XML_PI_END=122 +T__499=499 +ESCAPE_APOS=117 +ATTRIBUTE_CONTENT=21 +WHERE=63 +LAX=197 +T__471=471 +T__472=472 +EQ_ATOM=80 +T__470=470 +T__475=475 +T__476=476 +T__473=473 +PRAGMA=48 +T__474=474 +ESCAPE_QUOT=115 +T__469=469 +T__468=468 +T__467=467 +T__466=466 +IF=68 +T__341=341 +T__342=342 +FLWOR=6 +T__343=343 +T__344=344 +IN=67 +T__340=340 +COMMA=54 +IS=91 +WILDCARD=10 +SOME=174 +EXCEPT_OP=170 +T__478=478 +T__477=477 +T__479=479 +COLLECTION=151 +DIGIT=136 +T__339=339 +T__338=338 +T__335=335 +T__334=334 +T__337=337 +WITH=193 +T__336=336 +T__350=350 +T__351=351 +T__354=354 +CHAR_REF=204 +T__355=355 +T__352=352 +T__353=353 +XQUERY=163 +T__453=453 +IDIV_OP=914 +T__454=454 +EXACTLY=832 +T__451=451 +T__452=452 +T__450=450 +DEFAULT=166 +DESCENDANT=153 +T__449=449 +T__448=448 +T__447=447 +BANG=222 +T__446=446 +T__445=445 +T__444=444 +T__348=348 +T__347=347 +T__346=346 +T__345=345 +PHRASE=809 +END_TAG_START=111 +T__349=349 +T__360=360 +T__361=361 +T__362=362 +NMSTART=139 +NEQ=86 +T__363=363 +T__364=364 +QUESTION=60 +T__365=365 +T__366=366 +T__462=462 +T__463=463 +T__464=464 +T__465=465 +XPOINTER=15 +T__460=460 +T__461=461 +T__459=459 +LEAST=833 +WINDOW=838 +T__456=456 +T__455=455 +ISNOT=92 +T__458=458 +T__457=457 +PARAGRAPHS=844 +T__357=357 +T__356=356 +ANCESTORORSELF=155 +T__359=359 +T__358=358 +LET=66 +MODULE_DECL=37 +APOS=113 +STAR=61 +T__439=439 +DIV_OP=144 +T__259=259 +INTERSECTION_OP=169 +LETTER=135 +APOS_ATTRIBUTE_CONTENT=116 +T__258=258 +T__438=438 +T__257=257 +T__443=443 +T__262=262 +T__442=442 +T__263=263 +T__441=441 +T__260=260 +T__635=635 +T__440=440 +T__261=261 +T__634=634 +T__266=266 +T__633=633 +T__267=267 +NOT=800 +T__632=632 +T__264=264 +T__631=631 +T__265=265 +T__300=300 +UNARY_PLUS=14 +RPPAREN=103 +IMPORT=176 +T__247=247 +T__426=426 +SENTENCE=845 +T__246=246 +T__427=427 +T__249=249 +T__630=630 +T__248=248 +T__422=422 +T__423=423 +T__424=424 +GE_ATOM=85 +T__425=425 +T__625=625 +T__624=624 +T__250=250 +T__627=627 +T__251=251 +T__626=626 +T__252=252 +T__621=621 +T__253=253 +T__620=620 +T__254=254 +T__623=623 +T__255=255 +T__622=622 +T__256=256 +UNION_OP=168 +DIACRITICS=818 +T__629=629 +T__628=628 +CHILD=147 +T__318=318 +T__520=520 +OR_OP=71 +T__319=319 +T__419=419 +T__316=316 +T__317=317 +T__314=314 +T__315=315 +T__312=312 +T__313=313 +T__413=413 +NMCHAR=142 +T__414=414 +T__411=411 +T__412=412 +T__417=417 +T__418=418 +ELSE=70 +SELF_ABREV=110 +T__415=415 +T__416=416 +T__704=704 +T__612=612 +T__288=288 +T__703=703 +T__611=611 +T__289=289 +T__702=702 +T__610=610 +T__286=286 +T__701=701 +LCURLY=56 +UNARY_MINUS=13 +T__287=287 +T__700=700 +T__616=616 +T__421=421 +SEMICOLON=52 +T__284=284 +T__615=615 +T__420=420 +T__285=285 +T__614=614 +T__519=519 +T__282=282 +T__613=613 +T__518=518 +COMP_TEXT_CONSTRUCTOR=43 +T__283=283 +T__517=517 +T__322=322 +T__619=619 +T__516=516 +T__281=281 +T__321=321 +T__618=618 +T__515=515 +T__320=320 +FTOR=928 +T__709=709 +T__617=617 +T__514=514 +T__708=708 +T__513=513 +T__707=707 +T__512=512 +NE_ATOM=81 +T__706=706 +T__511=511 +T__705=705 +T__510=510 +T__305=305 +T__408=408 +COMP_PI_CONSTRUCTOR=45 +T__306=306 +T__409=409 +NCNAME=51 +T__307=307 +T__308=308 +LANGUAGE=826 +QNAME=4 +WS=126 +T__301=301 +T__302=302 +LOWERCASE=814 +T__303=303 +T__304=304 +T__400=400 +INSENSITIVE=817 +T__401=401 +T__402=402 +T__403=403 +FT_OPTION=792 +T__269=269 +T__309=309 +T__404=404 +T__268=268 +T__405=405 +T__406=406 +T__407=407 +T__713=713 +T__712=712 +T__715=715 +T__601=601 +T__714=714 +T__600=600 +T__508=508 +T__603=603 +FUNCTION_DECL=29 +T__602=602 +T__507=507 +T__711=711 +T__605=605 +T__410=410 +T__710=710 +T__604=604 +T__509=509 +END=829 +T__607=607 +T__504=504 +T__606=606 +T__503=503 +DSLASH=101 +T__609=609 +T__506=506 +T__311=311 +T__608=608 +T__505=505 +T__270=270 +DECIMAL_LITERAL=108 +T__310=310 +T__717=717 +T__500=500 +T__716=716 +T__719=719 +T__502=502 +T__718=718 +T__501=501 +RENAME=195 +T__215=215 +T__685=685 +T__216=216 +T__684=684 +T__213=213 +T__683=683 +T__214=214 +T__682=682 +OPTION=31 +T__681=681 +T__680=680 +BOUNDARY_SPACE=849 +T__217=217 +T__218=218 +T__542=542 +LPPAREN=102 +OCCURS=839 +SATISFIES=913 +T__679=679 +PREDICATE=5 +T__677=677 +LPAREN=49 +T__678=678 +ANDAND=221 +T__675=675 +XML_PI_START=125 +T__676=676 +T__672=672 +EMPTY_SEQUENCE=854 +T__671=671 +PARENT=105 +T__674=674 +COMP_ATTR_CONSTRUCTOR=42 +T__673=673 +SLASH=100 +T__207=207 +THEN=69 +T__208=208 +T__670=670 +T__209=209 +COLLATION=178 +REPLACE=189 +T__531=531 +T__530=530 +ANCESTOR=152 +T__521=521 +T__522=522 +ABSOLUTE_SLASH=8 +T__523=523 +T__524=524 +T__525=525 +T__526=526 +T__527=527 +T__528=528 +T__529=529 +T__668=668 +T__669=669 +T__210=210 +T__664=664 +MOST=834 +PRAGMA_START=97 +T__665=665 +T__212=212 +T__666=666 +T__211=211 +T__667=667 +LT_ATOM=82 +T__239=239 +PRECEDINGSIBLING=156 +T__237=237 +T__663=663 +T__238=238 +T__662=662 +T__235=235 +T__661=661 +ITEM=160 +T__236=236 +T__660=660 +TO=836 +T__564=564 +T__563=563 +ATOMIC_TYPE=32 +T__562=562 +T__561=561 +T__560=560 +STEMMING=819 +T__558=558 +T__559=559 +T__556=556 +T__557=557 +T__554=554 +TEXT=22 +T__555=555 +T__245=245 +T__655=655 +T__244=244 +T__656=656 +T__243=243 +T__653=653 +T__242=242 +T__654=654 +UNION=99 +T__241=241 +T__659=659 +T__240=240 +T__657=657 +T__658=658 +FOLLOWING_SIBLING=917 +T__229=229 +GROUP_BY=35 +SCHEMA=199 +T__650=650 +T__652=652 +T__651=651 +T__551=551 +T__550=550 +ENTIRE=830 +T__553=553 +VALIDATE=96 +T__552=552 +T__547=547 +T__548=548 +START=828 +DECLARE=177 +T__549=549 +T__543=543 +MODULE_IMPORT=38 +T__544=544 +ATTRIBUTE_TEST=40 +T__545=545 +T__546=546 +T__232=232 +T__231=231 +T__234=234 +ORDER_BY=34 +T__233=233 +T__646=646 +T__647=647 +T__230=230 +T__648=648 +T__649=649 +SENTENCES=843 +CAST=77 +T__764=764 +T__763=763 +EXTERNAL=167 +T__766=766 +T__765=765 +T__768=768 +T__767=767 +BASECHAR=133 +T__769=769 +FOLLOWINGSIBLING=157 +XML_CDATA_START=132 +CASE=196 +ENCODING=187 +DOUBLE_LITERAL=107 +DOCUMENT_NODE=921 +T__770=770 +T__771=771 +T__772=772 +T__773=773 +WORD=807 +T__777=777 +T__776=776 +T__775=775 +T__774=774 +UPPERCASE=815 +INSERT=192 +T__779=779 +T__778=778 +ATTRIBUTE_ABREV=104 +IDEOGRAPHIC=134 +T__780=780 +PRAGMA_END=98 +T__783=783 +T__784=784 +T__781=781 +T__782=782 +T__789=789 +T__786=786 +T__785=785 +NODE=146 +T__788=788 +T__787=787 +PREDEFINED_ENTITY_REF=203 +GREATEST=848 +VARIABLE_REF=17 +PROCESSING_INSTRUCTION=920 +COMP_NS_CONSTRUCTOR=46 +RELATIONSHIP=822 +NAMESPACE=165 +T__790=790 +T__791=791 +AND_OP=72 +FTSCORE_VAR=333 +VARIABLE=164 +BASE_URI=850 +INTEGER_LITERAL=109 +NOPRESERVE=200 +ANDEQ=93 +PROLOG=30 +QUOT_ATTRIBUTE_CONTENT=114 +FROM=835 +PRECEDING_SIBLING=919 +GLOBAL_VAR=28 +T__727=727 +DOLLAR=55 +T__728=728 +T__729=729 +T__720=720 +ORDER=171 +T__721=721 +T__722=722 +T__723=723 +DIGITS=137 +T__724=724 +MILD=799 +T__725=725 +XPOINTER_ID=16 +T__726=726 +ATTRIBUTE=20 +UPDATE=124 +FOR=65 +ABSOLUTE_DSLASH=9 +FOLLOWING=158 +FTCONTAINS=795 +NEXT_TOKEN=131 +T__738=738 +T__739=739 +XML_COMMENT=119 +T__292=292 +T__291=291 +T__290=290 +PARAGRAPH=846 +COPY_NAMESPACES=851 +T__732=732 +T__296=296 +T__733=733 +T__295=295 +OREQ=94 +T__730=730 +T__294=294 +T__731=731 +T__293=293 +T__736=736 +ALL=808 +T__737=737 +T__299=299 +T__734=734 +T__298=298 +COMP_DOC_CONSTRUCTOR=47 +T__735=735 +T__297=297 +STRIP=181 +STABLE=910 +GT_ATOM=84 +T__751=751 +BEFORE=78 +T__750=750 +AFTER=79 +GTEQ=88 +BASEURI=188 +UNORDERED=185 +DEF_COLLATION_DECL=26 +ANY=806 +SCORE=793 +ORDERING=182 +T__758=758 +T__759=759 +T__756=756 +T__757=757 +T__754=754 +T__755=755 +T__752=752 +VERSION_DECL=23 +T__753=753 +COMBINING_CHAR=140 +DOCUMENTNODE=150 +T__762=762 +T__761=761 +HEX_DIGITS=138 +T__760=760 +TIMES=840 +LEVELS=823 +MOD_OP=145 +TREAT=75 +'end'=775 +'most'=780 +'text'=22 +'inherit'=201 +'diacritics'=768 +'no-preserve'=200 +'greatest'=207 +'lax'=197 +'distance'=782 +'with'=193 +'start'=774 +'preserve'=180 +'value'=191 +'parent'=105 +'document'=149 +'mild'=754 +'thesaurus'=761 +'ftcontains'=752 +'document-node'=150 +'ascending'=212 +'sentence'=790 +'different'=787 +'stable'=211 +'unordered'=185 +'all'=758 +'sentences'=788 +'descendant'=153 +'not'=755 +'entire'=776 +'stemming'=769 +'exactly'=778 +'default'=166 +'sensitive'=766 +'ordered'=184 +'update'=124 +'window'=783 +'version'=162 +'relationship'=770 +'paragraph'=791 +'div'=144 +'element'=19 +'module'=33 +'preceding-sibling'=156 +'word'=757 +'replace'=189 +'strip'=181 +'union'=168 +'variable'=164 +'copy-namespaces'=209 +'ancestor'=152 +'any'=756 +'case'=196 +'levels'=771 +'ancestor-or-self'=155 +'external'=167 +'lowercase'=764 +'no-inherit'=202 +'node'=146 +'into'=194 +'satisfies'=214 +'phrase'=759 +'stop'=762 +'schema'=199 +'typeswitch'=186 +'declare'=177 +'xquery'=163 +'intersect'=216 +'language'=772 +'strict'=198 +'descendant-or-self'=154 +'schema-element'=218 +'boundary-space'=179 +'insensitive'=767 +'base-uri'=188 +'insert'=192 +'least'=779 +'function'=12 +'delete'=190 +'some'=174 +'wildcards'=773 +'import'=176 +'paragraphs'=789 +'xpointer'=15 +'order'=171 +'option'=31 +'following-sibling'=157 +'child'=147 +'collation'=178 +'content'=777 +'ft-option'=750 +'empty'=161 +'every'=175 +'idiv'=215 +'mod'=145 +'words'=763 +'at'=129 +'processing-instruction'=217 +'construction'=183 +'group'=173 +'descending'=213 +'encoding'=187 +'times'=785 +'comment'=148 +'same'=786 +'item'=160 +'uppercase'=765 +'preceding'=159 +'rename'=195 +'by'=172 +'namespace'=165 +'empty-sequence'=210 +'weight'=753 +'following'=158 +'to'=143 +'occurs'=784 +'ordering'=182 +'without'=760 +'attribute'=20 +'self'=128 +'except'=170 +'score'=751 +'from'=781 Copied: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.g (from rev 8010, branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.g) =================================================================== --- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.g (rev 0) +++ branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.g 2008-07-22 10:59:41 UTC (rev 8048) @@ -0,0 +1,224 @@ +/* + * eXist Open Source Native XML Database + * Copyright (C) 2007-2008 The eXist Project + * http://exist-db.org + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $Id$ + */ + +parser grammar FullTextExtParser; + +@header { +package org.exist.xquery.parser; +} + +ftOptionDecl +throws XPathException +: + decl=DECLARE! ftopt=FT_OPTION! ftMatchOption + ; + +ftScoreVar +: + SCORE DOLLAR varName=qName + -> ^(FTSCORE_VAR $varName) + ; + +ftContainsExpr + : + rangeExpr ( + FTCONTAINS^ ftSelection + ( ftIgnoreOption )? + )? + ; + +ftSelection throws XPathException +: + ftOr ( ( ftMatchOption | ftProximity )* ( WEIGHT^ rangeExpr )? ) + ; + +ftOr throws XPathException +: + ftAnd ( FTOR^ ftAnd )* + ; + +ftAnd throws XPathException +: + ftMildNot ( FTAND^ ftMildNot )* + ; + +ftMildNot throws XPathException +: + ftUnaryNot ( MILD^ NOT^ ftUnaryNot )* + ; + +ftUnaryNot throws XPathException +: + (BANG^)? ftWordSelection + ; + +ftWordSelection throws XPathException +: + ( ftWords ( ftTimes )? ) + | ( LPAREN! ftSelection RPAREN! ) + ; + +ftWords throws XPathException +: + ftWordsValue ( ftAnyallOption )? + ; + +ftWordsValue throws XPathException +: + literal | ( LCURLY! expr RCURLY! ) + ; + +ftAnyallOption throws XPathException +: + ( ANY^ ( WORD^ )? ) + | ( ALL^ ( WORD^ )? ) + | ( PHRASE^ ) + ; + +ftProximity throws XPathException +: + ftOrderedIndicator | ftWindow | ftDistance | ftScope | ftContent + ; + +ftOrderedIndicator throws XPathException +: + ORDERED^ + ; + +ftMatchOption throws XPathException +: + ftCaseOption + | ftDiacriticsOption + | ftLanguageOption + | ( WITH^ ( ftOnlyDiacriticsOption | ftStemOption | ftWildCardOption | ftWithThesaurusOption | ftWithStopWordOption ) + | WITHOUT^ ( ftOnlyDiacriticsOption | ftStemOption | ftWildCardOption | ( THESAURUS^ ) | ( STOP^ WORDS^ ) ) + ) + ; + +ftCaseOption throws XPathException +: + LOWERCASE^ + | UPPERCASE^ + | CASE^ ( SENSITIVE^ | INSENSITIVE^ ) + ; + +ftOnlyDiacriticsOption throws XPathException +: + DIACRITICS^ + ; + +ftDiacriticsOption throws XPathException +: + DIACRITICS^ + ( SENSITIVE^ | INSENSITIVE^ ) + ; + +ftStemOption throws XPathException +: + ( STEMMING ) + ; + +ftWithThesaurusOption throws XPathException +: + ( THESAURUS^ ( ftThesaurusID | DEFAULT ) ) + | ( THESAURUS^ LPAREN! ( ftThesaurusID | DEFAULT ) ( COMMA! ftThesaurusID )* RPAREN! ) + ; + +ftThesaurusID throws XPathException +: + AT^ STRING_LITERAL^ ( RELATIONSHIP^ STRING_LITERAL^ )? ( ftRange LEVELS^ )? + ; + +ftWithStopWordOption throws XPathException +: + ( ( STOP^ WORDS^ ftRefOrList ) | ( DEFAULT^ STOP^ WORDS^ ) ) + ( ftInclExclStringLiteral )* + ; + +ftRefOrList throws XPathException +: + ( AT^ STRING_LITERAL^ ) + | ( LPAREN! STRING_LITERAL^ ( COMMA! STRING_LITERAL^ )* RPAREN! ) + ; + +ftInclExclStringLiteral throws XPathException +: + ( UNION^ | EXCEPT^ ) ftRefOrList + ; + +ftLanguageOption throws XPathException +: + LANGUAGE^ STRING_LITERAL^ + ; + +ftWildCardOption throws XPathException +: + ( WILDCARDS^ ) + ; + +ftContent throws XPathException +: + ( AT^ ( START^ | END^ ) ) + | ( ENTIRE^ CONTENT^ ) + ; + +ftRange throws XPathException +: + ( EXACTLY^ unionExpr ) + | ( AT^ ( LEAST^ | MOST^ ) unionExpr ) + | ( FROM^ unionExpr TO_OP^ unionExpr ) + ; + +ftDistance throws XPathException +: + DISTANCE^ ftRange ftUnit + ; + +ftWindow throws XPathException +: + WINDOW^ ftRange ftUnit + ; + +ftTimes throws XPathException +: + OCCURS^ ftRange TIMES^ + ; + +ftScope throws XPathException +: + ( SAME^ | DIFFERENT^ ) ftBigUnit + ; + +ftUnit throws XPathException +: + WORDS^ | SENTENCES^ | PARAGRAPHS^ + ; + +ftBigUnit throws XPathException +: + SENTENCE^ | PARAGRAPH^ + ; + +ftIgnoreOption throws XPathException +: + WITHOUT^ CONTENT^ unionExpr + ; Copied: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.tokens (from rev 8042, branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExt.tokens) =================================================================== --- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.tokens (rev 0) +++ branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtParser.tokens 2008-07-22 10:59:41 UTC (rev 8048) @@ -0,0 +1,869 @@ +FUNCTION=12 +PREFIX_WILDCARD=11 +EXCEPT=825 +DISTANCE=837 +RPAREN=50 +STRING_LITERAL=106 +XML_CDATA_END=130 +PRECEDING=159 +WORDS=813 +PARENTHESIZED=7 +RETURN=64 +XML_PI=121 +ELEMENT=19 +EXPR_COMMENT=127 +EQ=53 +NAMESPACE_DECL=24 +LE_ATOM=83 +STRICT=198 +PRESERVE=180 +TYPESWITCH=186 +STOP=812 +CONTENT=831 +VALUE=191 +EMPTY=161 +GROUP=173 +INTERSECT=915 +FTAND=929 +SCHEMA_ELEMENT=922 +NO_PRESERVE=852 +GT=87 +LTEQ=90 +THESAURUS=811 +VERSION=162 +DESCENDANTORSELF=154 +ASCENDING=911 +TO_OP=143 +AT=129 +AS=59 +CONSTRUCTION=183 +DOCUMENT=149 +COMP_ELEM_CONSTRUCTOR=41 +PLUS=62 +CASTABLE=76 +BY=172 +ELEMENT_CONTENT=118 +INHERIT=201 +ANCESTOR_OR_SELF=918 +QUOT=112 +POSITIONAL_VAR=36 +MINUS=95 +MODULE=33 +ORDERED=184 +SAME=841 +VARIABLE_BINDING=18 +COLON=58 +INSTANCE=73 +WILDCARDS=827 +DEF_FUNCTION_NS_DECL=27 +RCURLY=57 +NOINHERIT=202 +DESCENDING=912 +SCHEMA_IMPORT=39 +SELF=128 +XML_COMMENT_END=120 +LT=89 +T__375=375 +T__569=569 +T__374=374 +T__568=568 +T__373=373 +T__567=567 +T__372=372 +T__566=566 +T__371=371 +T__565=565 +T__370=370 +T__574=574 +CHAR=206 +T__575=575 +DIFFERENT=842 +T__572=572 +T__573=573 +T__570=570 +T__369=369 +T__571=571 +T__367=367 +T__368=368 +PARENT_ABREV=205 +T__386=386 +T__388=388 +T__387=387 +T__577=577 +T__576=576 +T__579=579 +T__578=578 +XML_CDATA=123 +T__583=583 +T__580=580 +T__581=581 +T__582=582 +COMMENT=148 +INTO=194 +T__498=498 +T__497=497 +T__496=496 +NO_INHERIT=853 +T__495=495 +BOUNDARYSPACE=179 +T__494=494 +T__391=391 +T__493=493 +T__390=390 +T__687=687 +T__492=492 +T__686=686 +T__491=491 +T__490=490 +T__395=395 +OROR=220 +T__394=394 +T__393=393 +T__392=392 +T__399=399 +T__398=398 +WITHOUT=810 +T__397=397 +T__396=396 +EVERY=175 +T__389=389 +SENSITIVE=816 +T__596=596 +DELETE=190 +T__597=597 +WEIGHT=796 +T__594=594 +T__595=595 +EXTENDER=141 +OF=74 +T__698=698 +T__699=699 +T__599=599 +T__598=598 +DESCENDANT_OR_SELF=916 +COMP_COMMENT_CONSTRUCTOR=44 +DEF_NAMESPACE_DECL=25 +XML_PI_END=122 +T__499=499 +ESCAPE_APOS=117 +ATTRIBUTE_CONTENT=21 +WHERE=63 +LAX=197 +T__471=471 +T__472=472 +T__470=470 +EQ_ATOM=80 +T__475=475 +T__476=476 +T__473=473 +T__474=474 +PRAGMA=48 +T__469=469 +ESCAPE_QUOT=115 +T__468=468 +T__467=467 +T__466=466 +IF=68 +T__341=341 +FLWOR=6 +T__342=342 +T__343=343 +T__344=344 +IN=67 +T__340=340 +COMMA=54 +IS=91 +SOME=174 +WILDCARD=10 +EXCEPT_OP=170 +T__478=478 +T__477=477 +T__479=479 +COLLECTION=151 +DIGIT=136 +T__339=339 +T__338=338 +T__335=335 +T__334=334 +T__337=337 +WITH=193 +T__336=336 +T__350=350 +T__351=351 +T__354=354 +CHAR_REF=204 +T__355=355 +T__352=352 +T__353=353 +XQUERY=163 +T__453=453 +IDIV_OP=914 +T__454=454 +EXACTLY=832 +T__451=451 +T__452=452 +T__450=450 +DEFAULT=166 +DESCENDANT=153 +T__449=449 +T__448=448 +T__447=447 +BANG=222 +T__446=446 +T__445=445 +T__444=444 +T__348=348 +T__347=347 +T__346=346 +T__345=345 +PHRASE=809 +END_TAG_START=111 +T__349=349 +T__360=360 +T__361=361 +T__362=362 +NMSTART=139 +NEQ=86 +T__363=363 +T__364=364 +QUESTION=60 +T__365=365 +T__366=366 +T__462=462 +T__463=463 +T__464=464 +T__465=465 +XPOINTER=15 +T__460=460 +T__461=461 +T__459=459 +LEAST=833 +WINDOW=838 +T__456=456 +T__455=455 +ISNOT=92 +T__458=458 +T__457=457 +PARAGRAPHS=844 +T__357=357 +T__356=356 +ANCESTORORSELF=155 +T__359=359 +T__358=358 +LET=66 +MODULE_DECL=37 +APOS=113 +STAR=61 +T__439=439 +DIV_OP=144 +T__259=259 +INTERSECTION_OP=169 +LETTER=135 +APOS_ATTRIBUTE_CONTENT=116 +T__258=258 +T__438=438 +T__257=257 +T__443=443 +T__262=262 +T__442=442 +T__263=263 +T__441=441 +T__260=260 +T__635=635 +T__440=440 +T__261=261 +T__634=634 +T__266=266 +T__633=633 +T__267=267 +NOT=800 +T__632=632 +T__264=264 +T__631=631 +T__265=265 +T__300=300 +UNARY_PLUS=14 +RPPAREN=103 +IMPORT=176 +T__247=247 +T__426=426 +SENTENCE=845 +T__246=246 +T__427=427 +T__249=249 +T__630=630 +T__248=248 +T__422=422 +T__423=423 +T__424=424 +GE_ATOM=85 +T__425=425 +T__625=625 +T__624=624 +T__250=250 +T__627=627 +T__251=251 +T__626=626 +T__252=252 +T__621=621 +T__253=253 +T__620=620 +T__254=254 +T__623=623 +T__255=255 +T__622=622 +T__256=256 +UNION_OP=168 +DIACRITICS=818 +T__629=629 +T__628=628 +CHILD=147 +T__318=318 +T__520=520 +OR_OP=71 +T__319=319 +T__419=419 +T__316=316 +T__317=317 +T__314=314 +T__315=315 +T__312=312 +T__313=313 +T__413=413 +NMCHAR=142 +T__414=414 +T__411=411 +T__412=412 +T__417=417 +T__418=418 +ELSE=70 +SELF_ABREV=110 +T__415=415 +T__416=416 +T__704=704 +T__612=612 +T__288=288 +T__703=703 +T__611=611 +T__289=289 +T__702=702 +T__610=610 +T__286=286 +T__701=701 +LCURLY=56 +UNARY_MINUS=13 +T__287=287 +T__700=700 +T__616=616 +T__421=421 +SEMICOLON=52 +T__284=284 +T__615=615 +T__420=420 +T__285=285 +T__614=614 +T__519=519 +T__282=282 +T__613=613 +T__518=518 +COMP_TEXT_CONSTRUCTOR=43 +T__283=283 +T__517=517 +T__322=322 +T__619=619 +T__516=516 +T__281=281 +T__321=321 +FTOR=928 +T__320=320 +T__515=515 +T__618=618 +T__514=514 +T__617=617 +T__709=709 +T__513=513 +T__708=708 +NE_ATOM=81 +T__512=512 +T__707=707 +T__511=511 +T__706=706 +T__510=510 +T__705=705 +T__408=408 +T__305=305 +T__409=409 +T__306=306 +COMP_PI_CONSTRUCTOR=45 +T__307=307 +NCNAME=51 +T__308=308 +T__301=301 +WS=126 +QNAME=4 +LANGUAGE=826 +T__302=302 +T__303=303 +LOWERCASE=814 +T__304=304 +T__400=400 +T__401=401 +INSENSITIVE=817 +T__402=402 +T__403=403 +T__404=404 +T__309=309 +T__269=269 +FT_OPTION=792 +T__405=405 +T__268=268 +T__406=406 +T__407=407 +T__713=713 +T__712=712 +T__601=601 +T__715=715 +T__600=600 +T__714=714 +FUNCTION_DECL=29 +T__603=603 +T__508=508 +T__507=507 +T__602=602 +T__410=410 +T__605=605 +T__711=711 +T__509=509 +T__604=604 +T__710=710 +T__504=504 +T__607=607 +END=829 +DSLASH=101 +T__503=503 +T__606=606 +T__311=311 +T__506=506 +T__609=609 +T__310=310 +DECIMAL_LITERAL=108 +T__270=270 +T__505=505 +T__608=608 +T__500=500 +T__717=717 +T__716=716 +T__502=502 +T__719=719 +RENAME=195 +T__501=501 +T__718=718 +T__685=685 +T__215=215 +T__684=684 +T__216=216 +T__683=683 +T__213=213 +T__682=682 +T__214=214 +T__681=681 +OPTION=31 +T__680=680 +T__217=217 +BOUNDARY_SPACE=849 +T__218=218 +T__542=542 +LPPAREN=102 +OCCURS=839 +SATISFIES=913 +T__679=679 +PREDICATE=5 +T__677=677 +T__678=678 +LPAREN=49 +T__675=675 +ANDAND=221 +T__676=676 +XML_PI_START=125 +T__672=672 +T__671=671 +EMPTY_SEQUENCE=854 +T__674=674 +PARENT=105 +T__673=673 +COMP_ATTR_CONSTRUCTOR=42 +SLASH=100 +THEN=69 +T__207=207 +T__670=670 +T__208=208 +T__209=209 +COLLATION=178 +REPLACE=189 +T__531=531 +T__530=530 +T__521=521 +ANCESTOR=152 +T__522=522 +T__523=523 +ABSOLUTE_SLASH=8 +T__524=524 +T__525=525 +T__526=526 +T__527=527 +T__528=528 +T__668=668 +T__529=529 +T__669=669 +T__664=664 +T__210=210 +T__665=665 +PRAGMA_START=97 +MOST=834 +T__666=666 +T__212=212 +T__667=667 +T__211=211 +LT_ATOM=82 +T__239=239 +PRECEDINGSIBLING=156 +T__663=663 +T__237=237 +T__662=662 +T__238=238 +T__661=661 +T__235=235 +T__660=660 +T__236=236 +ITEM=160 +T__564=564 +TO=836 +T__563=563 +T__562=562 +ATOMIC_TYPE=32 +T__561=561 +T__560=560 +T__558=558 +STEMMING=819 +T__559=559 +T__556=556 +T__557=557 +T__554=554 +T__555=555 +TEXT=22 +T__655=655 +T__245=245 +T__656=656 +T__244=244 +T__653=653 +T__243=243 +T__654=654 +T__242=242 +T__659=659 +T__241=241 +UNION=99 +T__240=240 +T__657=657 +T__658=658 +FOLLOWING_SIBLING=917 +T__229=229 +GROUP_BY=35 +T__650=650 +SCHEMA=199 +T__652=652 +T__651=651 +T__551=551 +T__550=550 +T__553=553 +ENTIRE=830 +T__552=552 +VALIDATE=96 +T__547=547 +T__548=548 +T__549=549 +DECLARE=177 +START=828 +T__543=543 +T__544=544 +MODULE_IMPORT=38 +T__545=545 +ATTRIBUTE_TEST=40 +T__546=546 +T__232=232 +T__231=231 +T__234=234 +T__233=233 +ORDER_BY=34 +T__646=646 +T__647=647 +T__648=648 +T__230=230 +T__649=649 +T__764=764 +CAST=77 +SENTENCES=843 +T__763=763 +T__766=766 +EXTERNAL=167 +T__765=765 +T__768=768 +T__767=767 +T__769=769 +BASECHAR=133 +FOLLOWINGSIBLING=157 +XML_CDATA_START=132 +CASE=196 +ENCODING=187 +DOUBLE_LITERAL=107 +DOCUMENT_NODE=921 +T__770=770 +T__771=771 +T__772=772 +T__773=773 +T__777=777 +WORD=807 +T__776=776 +T__775=775 +T__774=774 +UPPERCASE=815 +T__779=779 +INSERT=192 +T__778=778 +ATTRIBUTE_ABREV=104 +IDEOGRAPHIC=134 +T__780=780 +PRAGMA_END=98 +T__783=783 +T__784=784 +T__781=781 +T__782=782 +T__789=789 +T__786=786 +T__785=785 +T__788=788 +NODE=146 +T__787=787 +PREDEFINED_ENTITY_REF=203 +GREATEST=848 +VARIABLE_REF=17 +PROCESSING_INSTRUCTION=920 +COMP_NS_CONSTRUCTOR=46 +RELATIONSHIP=822 +NAMESPACE=165 +T__790=790 +T__791=791 +AND_OP=72 +FTSCORE_VAR=333 +VARIABLE=164 +BASE_URI=850 +NOPRESERVE=200 +INTEGER_LITERAL=109 +ANDEQ=93 +PROLOG=30 +QUOT_ATTRIBUTE_CONTENT=114 +FROM=835 +PRECEDING_SIBLING=919 +GLOBAL_VAR=28 +DOLLAR=55 +T__727=727 +T__728=728 +T__729=729 +ORDER=171 +T__720=720 +T__721=721 +T__722=722 +DIGITS=137 +T__723=723 +T__724=724 +XPOINTER_ID=16 +T__725=725 +MILD=799 +ATTRIBUTE=20 +T__726=726 +UPDATE=124 +FOR=65 +ABSOLUTE_DSLASH=9 +FOLLOWING=158 +FTCONTAINS=795 +NEXT_TOKEN=131 +T__738=738 +XML_COMMENT=119 +T__739=739 +T__292=292 +T__291=291 +T__290=290 +PARAGRAPH=846 +T__296=296 +T__732=732 +COPY_NAMESPACES=851 +OREQ=94 +T__295=295 +T__733=733 +T__294=294 +T__730=730 +T__293=293 +T__731=731 +T__736=736 +T__299=299 +T__737=737 +ALL=808 +COMP_DOC_CONSTRUCTOR=47 +T__298=298 +T__734=734 +T__297=297 +T__735=735 +STRIP=181 +STABLE=910 +GT_ATOM=84 +T__751=751 +T__750=750 +BEFORE=78 +GTEQ=88 +AFTER=79 +BASEURI=188 +UNORDERED=185 +DEF_COLLATION_DECL=26 +ANY=806 +SCORE=793 +T__758=758 +ORDERING=182 +T__759=759 +T__756=756 +T__757=757 +T__754=754 +T__755=755 +T__752=752 +T__753=753 +VERSION_DECL=23 +T__762=762 +DOCUMENTNODE=150 +COMBINING_CHAR=140 +T__761=761 +T__760=760 +HEX_DIGITS=138 +MOD_OP=145 +LEVELS=823 +TIMES=840 +TREAT=75 +'end'=775 +'most'=780 +'diacritics'=768 +'inherit'=201 +'text'=22 +'no-preserve'=200 +'greatest'=207 +'lax'=197 +'distance'=782 +'with'=193 +'start'=774 +'preserve'=180 +'value'=191 +'parent'=105 +'document'=149 +'mild'=754 +'thesaurus'=761 +'ftcontains'=752 +'document-node'=150 +'ascending'=212 +'sentence'=790 +'different'=787 +'stable'=211 +'unordered'=185 +'all'=758 +'sentences'=788 +'descendant'=153 +'entire'=776 +'not'=755 +'exactly'=778 +'stemming'=769 +'sensitive'=766 +'default'=166 +'update'=124 +'ordered'=184 +'window'=783 +'version'=162 +'relationship'=770 +'paragraph'=791 +'element'=19 +'div'=144 +'module'=33 +'preceding-sibling'=156 +'replace'=189 +'word'=757 +'strip'=181 +'union'=168 +'variable'=164 +'copy-namespaces'=209 +'ancestor'=152 +'any'=756 +'case'=196 +'levels'=771 +'ancestor-or-self'=155 +'external'=167 +'lowercase'=764 +'no-inherit'=202 +'node'=146 +'into'=194 +'satisfies'=214 +'phrase'=759 +'stop'=762 +'schema'=199 +'typeswitch'=186 +'declare'=177 +'xquery'=163 +'intersect'=216 +'language'=772 +'strict'=198 +'descendant-or-self'=154 +'schema-element'=218 +'boundary-space'=179 +'insensitive'=767 +'base-uri'=188 +'insert'=192 +'least'=779 +'function'=12 +'delete'=190 +'some'=174 +'wildcards'=773 +'import'=176 +'paragraphs'=789 +'xpointer'=15 +'order'=171 +'option'=31 +'following-sibling'=157 +'child'=147 +'collation'=178 +'content'=777 +'ft-option'=750 +'empty'=161 +'every'=175 +'idiv'=215 +'mod'=145 +'words'=763 +'at'=129 +'construction'=183 +'processing-instruction'=217 +'group'=173 +'descending'=213 +'encoding'=187 +'times'=785 +'same'=786 +'comment'=148 +'item'=160 +'uppercase'=765 +'preceding'=159 +'rename'=195 +'by'=172 +'empty-sequence'=210 +'namespace'=165 +'following'=158 +'weight'=753 +'to'=143 +'occurs'=784 +'ordering'=182 +'without'=760 +'attribute'=20 +'self'=128 +'except'=170 +'score'=751 +'from'=781 Modified: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtTreeParser.g =================================================================== --- branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtTreeParser.g 2008-07-22 05:41:37 UTC (rev 8047) +++ branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtTreeParser.g 2008-07-22 10:59:41 UTC (rev 8048) @@ -24,39 +24,42 @@ @header { package org.exist.xquery.parser; + + import org.exist.xquery.Expression; + import org.exist.xquery.PathExpr; } ftSelection [PathExpr path] returns [Expression step] throws XPathException, PermissionDeniedException, EXistException @init { -$step = null; -System.out.println("Got here"); -}: + $step = null; + PathExpr left = new PathExpr(gParent.getContext()); + PathExpr right = new PathExpr(gParent.getContext()); + System.out.println("Got here"); +} +: ^( andand=FTAND - { PathExpr left = new PathExpr(context); - PathExpr right = new PathExpr(context); - System.out.println("&&&"); - } - sel = ftSelection [left] - ( sel = ftSelection [path] )* + { System.out.println("&&&"); } + sel=ftSelection [left] + ( sel=ftSelection [path] )* + { $step = $sel.step; } ) | ^( www=FTOR - { PathExpr left = new PathExpr(context); - PathExpr right = new PathExpr(context); - System.out.println("|||"); - } - sel = ftSelection [left] - ( sel = ftSelection [path] )* + { System.out.println("|||"); } + sel=ftSelection [left] + ( sel=ftSelection [path] )* + { $step = $sel.step; } ) | ^( band=BANG { System.out.println("bang"); } - sel = ftSelection [path] + sel=ftSelection [path] + { $step = $sel.step; } ) | ^( @@ -64,7 +67,8 @@ { System.out.println("mild in "); } ^( MILD { } - sel = ftSelection[path] + sel=ftSelection[path] + { $step = $sel.step; } ) ) | @@ -73,7 +77,8 @@ ^( OCCURS { System.out.println("occurs"); } ( - re = ftRangeExpr[path] + rex=ftRangeExpr[path] + { $step = $rex.step; } ) ) ) @@ -81,7 +86,8 @@ ^( WEIGHT ( - ex = expr [path] + ex=expr [path] + { $step = $ex.step; } ) ) | @@ -92,12 +98,16 @@ ^( LANGUAGE { System.out.println("language");} ) )? ) - | - le = literalExpr [path] - { System.out.println("Got Literal"); } - | - ex = expr [path] - { System.out.println("Got Expr"); } + | // fixme! - path can't be found + /* le=literalExpr [$path] */ + le=literalExpr [new PathExpr(gParent.getContext())] + { $step = $le.step; + System.out.println("Got Literal"); } + | // fixme! - path can't be found + /* ex=expr [$path] */ + ex=expr [new PathExpr(gParent.getContext())] + { $step = $ex.step; + System.out.println("Got Expr"); } ( ^( ANY {System.out.println("any"); } @@ -113,16 +123,19 @@ )? | mo = ftMatchOption [path] - { $step = $mo.step} + { $step = $mo.step; } ; ftRangeExpr [PathExpr path] returns [Expression step] throws XPathException, PermissionDeniedException, EXistException @init { -$step = null; -System.out.println("Got here"); -}: + $step = null; + PathExpr left = new PathExpr(gParent.getContext()); + PathExpr right = new PathExpr(gParent.getContext()); + System.out.println("Got here"); +} +: ^( EXACTLY {System.out.println("ex");} ex = expr[path] @@ -148,10 +161,7 @@ TO ^( FROM - {System.out.println("to"); - PathExpr left = new PathExpr(context); - PathExpr right = new PathExpr(context); - } + { System.out.println("to"); } ( ex = expr[left] ex = expr[right] @@ -164,8 +174,9 @@ returns [Expression step] throws XPathException, PermissionDeniedException, EXistException @init { -$step = null; -}: + $step = null; +} +: ^( WORDS { System.out.println("words"); } ) @@ -183,9 +194,10 @@ returns [Expression step] throws XPathException, PermissionDeniedException, EXistException @init { -$step = null; -System.out.println("ftThesaurus"); -}: + $step = null; + System.out.println("ftThesaurus"); +} +: ^( DEFAULT { System.out.println("default"); } ) @@ -205,13 +217,13 @@ ) ) - (re = ftRangeExpr[path])? + (rex=ftRangeExpr[path])? ) ) | ^( - LEVELS { System.out.println("levels"); } - ( thes = ftThesaurus[path] ) + LEVELS { System.out.println("levels"); } + ( thes=ftThesaurus[path] ) ) ; @@ -219,21 +231,22 @@ returns [Expression step] throws XPathException, PermissionDeniedException, EXistException @init { -$step = null; -System.out.println("ftStopWords"); -PathExpr left = new PathExpr(context); -PathExpr right = new PathExpr(context); -}: -; + $step = null; + PathExpr left = new PathExpr(gParent.getContext()); + PathExpr right = new PathExpr(gParent.getContext()); + System.out.println("ftStopWords"); +} +: + ; ftStopWords [PathExpr path] returns [Expression step] throws XPathException, PermissionDeniedException, EXistException @init { -$step = null; -System.out.println("ftStopWords"); -PathExpr left = new PathExpr(context); -PathExpr right = new PathExpr(context); + $step = null; + System.out.println("ftStopWords"); + PathExpr left = new PathExpr(gParent.getContext()); + PathExpr right = new PathExpr(gParent.getContext()); }: ^( DEFAULT { System.out.println("default stop words"); } @@ -264,9 +277,12 @@ returns [Expression step] throws XPathException, PermissionDeniedException, EXistException @init { -$step = null; -System.out.println("Other"); -}: + $step = null; + PathExpr left = new PathExpr(gParent.getContext()); + PathExpr right = new PathExpr(gParent.getContext()); + System.out.println("Other"); +} +: ^( LOWERCASE { } ) @@ -394,22 +410,14 @@ ) | ^( - WINDOW { System.out.println("window"); - PathExpr left = new PathExpr(context); - PathExpr right = new PathExpr(context); } - re = ftRangeExpr[left] + WINDOW { System.out.println("window"); } + rex = ftRangeExpr[left] uni = ftUnit[right] ) | ^( - DISTANCE - { - System.out.println("distance"); - PathExpr left = new PathExpr(context); - PathExpr right = new PathExpr(context); - } - - re = ftRangeExpr[left] + DISTANCE { System.out.println("distance");} + rex = ftRangeExpr[left] uni = ftUnit[right] ) | Modified: branches/ljo/antlr3/src/org/exist/xquery/parser/FullTextExtTre... [truncated message content] |