|
Lines 13-19
Link Here
|
| 13 |
|
13 |
|
| 14 |
package org.eclipse.wst.xml.xpath2.processor.internal; |
14 |
package org.eclipse.wst.xml.xpath2.processor.internal; |
| 15 |
|
15 |
|
|
|
16 |
import java.math.BigDecimal; |
| 17 |
import java.math.BigInteger; |
| 16 |
import java.util.*; |
18 |
import java.util.*; |
|
|
19 |
import org.eclipse.wst.xml.xpath2.processor.ast.XPath; |
| 17 |
import org.eclipse.wst.xml.xpath2.processor.internal.ast.*; |
20 |
import org.eclipse.wst.xml.xpath2.processor.internal.ast.*; |
| 18 |
import org.eclipse.wst.xml.xpath2.processor.internal.types.*; |
21 |
import org.eclipse.wst.xml.xpath2.processor.internal.types.*; |
| 19 |
|
22 |
|
|
Lines 56-61
Link Here
|
| 56 |
terminal String AND, OR; |
59 |
terminal String AND, OR; |
| 57 |
terminal EMPTY, ITEM, NODE, DOCUMENT_NODE, TEXT, COMMENT; |
60 |
terminal EMPTY, ITEM, NODE, DOCUMENT_NODE, TEXT, COMMENT; |
| 58 |
terminal PROCESSING_INSTRUCTION, SCHEMA_ATTRIBUTE, ELEMENT, SCHEMA_ELEMENT; |
61 |
terminal PROCESSING_INSTRUCTION, SCHEMA_ATTRIBUTE, ELEMENT, SCHEMA_ELEMENT; |
|
|
62 |
// Unused in XPath 2, but reserved for compatibility with XQuery |
| 63 |
terminal TYPESWITCH; |
| 59 |
|
64 |
|
| 60 |
terminal BigInteger INTEGER; |
65 |
terminal BigInteger INTEGER; |
| 61 |
terminal Double DOUBLE; |
66 |
terminal Double DOUBLE; |
|
Lines 63-69
Link Here
|
| 63 |
terminal String STRING, NCNAME; |
68 |
terminal String STRING, NCNAME; |
| 64 |
|
69 |
|
| 65 |
|
70 |
|
| 66 |
non terminal String Prefix, LocalPart, NCName; |
71 |
non terminal String Prefix, LocalPart, NCName, UnqualifiedNCName, UnqualifiedLocalPart; |
| 67 |
non terminal StringLiteral StringLiteral; |
72 |
non terminal StringLiteral StringLiteral; |
| 68 |
non terminal QName ElementDeclaration, ElementNameOrWildcard, TypeName, ElementName; |
73 |
non terminal QName ElementDeclaration, ElementNameOrWildcard, TypeName, ElementName; |
| 69 |
non terminal QName AttributeDeclaration, AttribNameOrWildcard, AttributeName; |
74 |
non terminal QName AttributeDeclaration, AttribNameOrWildcard, AttributeName; |
|
Lines 630-639
Link Here
|
| 630 |
|
635 |
|
| 631 |
TypeName ::= QName:n {: RESULT = n; :}; |
636 |
TypeName ::= QName:n {: RESULT = n; :}; |
| 632 |
|
637 |
|
| 633 |
IntegerLiteral ::= INTEGER:i {: RESULT = new IntegerLiteral(i.intValue()); :}; |
638 |
IntegerLiteral ::= INTEGER:i {: RESULT = new IntegerLiteral(i); :}; |
| 634 |
|
639 |
|
| 635 |
DecimalLiteral ::= DECIMAL:d |
640 |
DecimalLiteral ::= DECIMAL:d |
| 636 |
{: RESULT = new DecimalLiteral(d.doubleValue()); :} |
641 |
{: RESULT = new DecimalLiteral(d); :} |
| 637 |
; |
642 |
; |
| 638 |
|
643 |
|
| 639 |
DoubleLiteral ::= DOUBLE:d |
644 |
DoubleLiteral ::= DOUBLE:d |
|
Lines 644-661
Link Here
|
| 644 |
|
649 |
|
| 645 |
VarName ::= QName:n {: RESULT = n; :}; |
650 |
VarName ::= QName:n {: RESULT = n; :}; |
| 646 |
|
651 |
|
| 647 |
QName ::= LocalPart:l {: RESULT = new QName(l); :} |
652 |
QName ::= UnqualifiedLocalPart:l {: RESULT = new QName(l); :} |
| 648 |
| Prefix:p COLON LocalPart:l {: RESULT = new QName(p,l); :} |
653 |
| Prefix:p COLON LocalPart:l {: RESULT = new QName(p,l); :} |
| 649 |
|
654 |
; |
| 650 |
// XXX hack to get empty working for now... |
|
|
| 651 |
// for fn:empty at least |
| 652 |
| Prefix:p COLON EMPTY {: RESULT = new QName(p, "empty"); :} |
| 653 |
; |
| 654 |
|
655 |
|
| 655 |
Prefix ::= NCName:n {: RESULT = n; :}; |
656 |
Prefix ::= NCName:n {: RESULT = n; :}; |
| 656 |
|
657 |
|
| 657 |
LocalPart ::= NCName:n {: RESULT = n; :}; |
658 |
LocalPart ::= NCName:n {: RESULT = n; :}; |
| 658 |
|
659 |
|
|
|
660 |
UnqualifiedLocalPart ::= UnqualifiedNCName:n {: RESULT = n; :}; |
| 661 |
|
| 659 |
NCName ::= NCNAME:n {: RESULT = n; :} | |
662 |
NCName ::= NCNAME:n {: RESULT = n; :} | |
| 660 |
TO:n {: RESULT = new String("to"); :} | |
663 |
TO:n {: RESULT = new String("to"); :} | |
| 661 |
CHILD:n {: RESULT = new String("child"); :} | |
664 |
CHILD:n {: RESULT = new String("child"); :} | |
|
Lines 693-697
Link Here
|
| 693 |
OR:n {: RESULT = new String("or"); :} | |
696 |
OR:n {: RESULT = new String("or"); :} | |
| 694 |
DIV:n {: RESULT = new String("div"); :} | |
697 |
DIV:n {: RESULT = new String("div"); :} | |
| 695 |
IDIV:n {: RESULT = new String("idiv"); :} | |
698 |
IDIV:n {: RESULT = new String("idiv"); :} | |
|
|
699 |
COMMENT:n {: RESULT = new String("comment"); :} | |
| 700 |
DOCUMENT_NODE:n {: RESULT = new String("document-node"); :} | |
| 701 |
ELEMENT:n {: RESULT = new String("element"); :} | |
| 702 |
EMPTY:n {: RESULT = new String("empty"); :} | |
| 703 |
ITEM:n {: RESULT = new String("item"); :} | |
| 704 |
NODE:n {: RESULT = new String("node"); :} | |
| 705 |
PROCESSING_INSTRUCTION:n {: RESULT = new String("processing-instruction"); :} | |
| 706 |
SCHEMA_ATTRIBUTE:n {: RESULT = new String("schema-attribute"); :} | |
| 707 |
SCHEMA_ELEMENT:n {: RESULT = new String("schema-element"); :} | |
| 708 |
TEXT:n {: RESULT = new String("text"); :} | |
| 709 |
TYPESWITCH:n {: RESULT = new String("typeswitch"); :} | |
| 710 |
MOD:n {: RESULT = new String("mod"); :} |
| 711 |
; |
| 712 |
|
| 713 |
UnqualifiedNCName ::= NCNAME:n {: RESULT = n; :} | |
| 714 |
TO:n {: RESULT = new String("to"); :} | |
| 715 |
CHILD:n {: RESULT = new String("child"); :} | |
| 716 |
DESCENDANT:n {: RESULT = new String("descendant"); :} | |
| 717 |
SELF:n {: RESULT = new String("self"); :} | |
| 718 |
DESCENDANT_OR_SELF:n {: RESULT = new String("descendant-of-self"); :} | |
| 719 |
FOLLOWING_SIBLING:n {: RESULT = new String("following-sibling"); :} | |
| 720 |
FOLLOWING:n {: RESULT = new String("following"); :} | |
| 721 |
NAMESPACE:n {: RESULT = new String("namespace"); :} | |
| 722 |
PARENT:n {: RESULT = new String("parent"); :} | |
| 723 |
ANCESTOR:n {: RESULT = new String("ancestor"); :} | |
| 724 |
PRECEDING_SIBLING:n {: RESULT = new String("preceding-sibling"); :} | |
| 725 |
PRECEDING:n {: RESULT = new String("preceding"); :} | |
| 726 |
ANCESTOR_OR_SELF:n {: RESULT = new String("ancestor-or-self"); :} | |
| 727 |
UNION:n {: RESULT = new String("union"); :} | |
| 728 |
INTERSECT:n {: RESULT = new String("intersect"); :} | |
| 729 |
EXCEPT:n {: RESULT = new String("except"); :} | |
| 730 |
INSTANCE:n {: RESULT = new String("instance"); :} | |
| 731 |
OF:n {: RESULT = new String("of"); :} | |
| 732 |
TREAT:n {: RESULT = new String("as"); :} | |
| 733 |
CASTABLE:n {: RESULT = new String("castable"); :} | |
| 734 |
CAST:n {: RESULT = new String("cast"); :} | |
| 735 |
IS:n {: RESULT = new String("is"); :} | |
| 736 |
FOR:n {: RESULT = new String("for"); :} | |
| 737 |
IN:n {: RESULT = new String("in"); :} | |
| 738 |
RETURN:n {: RESULT = new String("return"); :} | |
| 739 |
SATISFIES:n {: RESULT = new String("satisfies"); :} | |
| 740 |
SOME:n {: RESULT = new String("some"); :} | |
| 741 |
EVERY:n {: RESULT = new String("every"); :} | |
| 742 |
THEN:n {: RESULT = new String("then"); :} | |
| 743 |
ELSE:n {: RESULT = new String("else"); :} | |
| 744 |
AND:n {: RESULT = new String("and"); :} | |
| 745 |
OR:n {: RESULT = new String("or"); :} | |
| 746 |
DIV:n {: RESULT = new String("div"); :} | |
| 747 |
IDIV:n {: RESULT = new String("idiv"); :} | |
| 696 |
MOD:n {: RESULT = new String("mod"); :} |
748 |
MOD:n {: RESULT = new String("mod"); :} |
| 697 |
; |
749 |
; |
|
|
750 |
|