From 5ae00c5528081017b5faa0eb0e3fb16064bdd813 Mon Sep 17 00:00:00 2001 From: Timothy Washington Date: Fri, 28 Nov 2008 11:09:26 -0500 Subject: [PATCH] adding some test epressions --- cc/xpath.sablecc | 64 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/cc/xpath.sablecc b/cc/xpath.sablecc index c5e6a69..08bfabe 100755 --- a/cc/xpath.sablecc +++ b/cc/xpath.sablecc @@ -32,6 +32,8 @@ Package com.interrupt.cc.xpath; ----------- + +-- Expression tests //system/bookkeeping /system/bookkeeping system/bookkeeping @@ -40,9 +42,9 @@ system/bookkeeping -- forward axis descendant::node() attribute::attribute() -self::element() -descendant-or-self::element() -following-sibling::node() +./self::element() +/descendant-or-self::element() +//following-sibling::node() following::element() namespace::node() @@ -53,6 +55,38 @@ preceding-sibling::node() preceding::node() ancestor-or-self::node() +-- predicates +./child::node()[ @asdf='' ] +./child::node()/child::service/child::port/child::soap:address/attribute::location +./child::node()[]/child::service/child::port/child::soap:address/attribute::location +-- ./child::node()[ @name='tim' ] +-- ./child::node()[ 1 ] +-- ./child::node()[ 1 ]/child::service/child::port/child::soap:address/attribute::location + + +-- for + + +-- if / then / else + + +-- or / and + + +-- cast / castable + + +-- some / every + + +-- intersect / except + + +-- instanceof + + +-- treat + */ @@ -186,7 +220,6 @@ Helpers digits = [0-9]+; escapequot = '""'; - comment = '(:' (char)* ':)'; doubleliteral_helper = (('.' digits) | (digits ('.' [0-9]*)?)) ('e' | 'E') ('+' | '-')? digits; @@ -202,6 +235,11 @@ Helpers //comment = '(:' (commentcontents | comment)* ':)'; //commentcontents = [char+ - (char* ('(:' | ':)') char*)]; + tab = 9; + cr = 13; + lf = 10; + eol = cr lf | cr | lf; // This takes care of different platforms + Tokens @@ -356,14 +394,13 @@ Tokens fn_schema_element = 'schema-element'; fn_text = 'text'; fn_typeswitch = 'typeswitch'; - - + + xmlns = 'xmlns'; ncnamechar = namechar; //ncnamechar = [namechar - ':']; letter = basechar+; - //letter = 'asdf'; underscore = '_'; @@ -374,8 +411,17 @@ Tokens doubleliteral = doubleliteral_helper; stringliteral = stringliteral_helper; - - + + whitespace = (' ' | tab | eol); + comment = '(:' (char)* ':)'; + + +Ignored Tokens + + whitespace, + comment; + + Productions xpath = expr; -- 2.11.4.GIT