Skip to content

1720 grammar simplification #1732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions specifications/grammar-40/grammar.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
or via an XSLT stylesheet or other transformation, may generate
a parser compiler specification such as for YACC or JavaCC.

Norm and Scott moved this file, and added an explicit prefix, as part of the
transition toward a unified build process for last call and beyond. This involved
moving the location of the CVS repository, For earlier history information,
see /WWW/XML/Group/xpath-query-src/grammar.dtd
In 2025 Michael Kay simplified the DTD to remove parts that were no
longer used or maintained.

=========================================================================-->
<!-- The root element of the definition -->
<!ELEMENT g:grammar ((g:language)+, (g:start)+,
(g:exprProduction | g:production | g:exposition-production)+
, g:token*, (g:state-list)?)>
<!ELEMENT g:grammar (
g:language+,
g:start+,
g:production+,
g:token*)>
<!ATTLIST g:grammar
xmlns:g CDATA #FIXED "http://www.w3.org/2001/03/XPath/grammar"
>
Expand Down Expand Up @@ -146,44 +146,44 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
process-value (no | yes) #IMPLIED
>

<!-- Talk to FS folks about what this is really supposed to mean. -sb -->
<!--<!-\- Talk to FS folks about what this is really supposed to mean. -sb -\->
<!ELEMENT g:emph (#PCDATA)>
<!ATTLIST g:emph
ignoreCase CDATA #IMPLIED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
>

-->

<!--=================== Lexical State Transitions =================== -->

<!ELEMENT g:state-list (g:state)+>
<!--<!ELEMENT g:state-list (g:state)+>
<!ATTLIST g:state-list
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
>

<!ELEMENT g:state (g:description?, g:transition+)>
-->
<!--<!ELEMENT g:state (g:description?, g:transition+)>
<!ATTLIST g:state
name ID #REQUIRED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
show (yes | no) #IMPLIED
>
>-->

<!ELEMENT g:tref EMPTY>
<!--<!ELEMENT g:tref EMPTY>
<!ATTLIST g:tref
name IDREF #REQUIRED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
show (yes | no) #IMPLIED
>
>-->

<!ELEMENT g:description ANY>
<!--<!ELEMENT g:description ANY>
<!ATTLIST g:description
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
>
>-->

<!-- Define a transition for a token or set of tokens.
Attributes:
Expand All @@ -194,36 +194,36 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
used for the action.
action -> State stack action.
-->
<!ELEMENT g:transition (g:description?, g:tref+)>
<!--<!ELEMENT g:transition (g:description?, g:tref+)>
<!ATTLIST g:transition
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
next-state IDREF #IMPLIED
action CDATA #IMPLIED
>
>-->

<!--=================== Parser Production Specifications ===============-->
<!-- A production that defines a "cascade" of productions that define
operator precedence.
name -> the ID of the production.
if -> space separated list of tokens for conditional processing.
-->
<!ELEMENT g:exprProduction (g:level+)>
<!--<!ELEMENT g:exprProduction (g:level+)>
<!ATTLIST g:exprProduction
name ID #REQUIRED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
condition CDATA #IMPLIED
>
>-->

<!ELEMENT g:level (g:postfix | g:binary | g:prefix | g:primary)+>
<!--<!ELEMENT g:level (g:postfix | g:binary | g:prefix | g:primary)+>
<!ATTLIST g:level
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
level-user-action CDATA #IMPLIED
>
>-->

<!-- Basic non-terminal production.
name -> the ID of the production.
Expand Down Expand Up @@ -251,7 +251,7 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
subtract-reg-expr CDATA #IMPLIED
>

<!ELEMENT g:exposition-production (g:optional | g:ref | g:xref | g:choice | g:sequence | g:zeroOrMore | g:oneOrMore | g:string)+>
<!--<!ELEMENT g:exposition-production (g:optional | g:ref | g:xref | g:choice | g:sequence | g:zeroOrMore | g:oneOrMore | g:string)+>
<!ATTLIST g:exposition-production
name CDATA #REQUIRED
if IDREFS #IMPLIED
Expand All @@ -262,7 +262,7 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
whitespace-spec (not-significant | significant | explicit) #IMPLIED
comment-id CDATA #IMPLIED
xgc-id CDATA #IMPLIED
>
>-->

<!-- Defines a binary operator.
name -> the ID of the production.
Expand All @@ -275,55 +275,55 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
</choice>
</binary>
-->
<!ELEMENT g:binary (g:ref | g:xref | g:choice | g:string | g:sequence)>
<!--<!ELEMENT g:binary (g:ref | g:xref | g:choice | g:string | g:sequence)>
<!ATTLIST g:binary
name ID #REQUIRED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
prefix-seq-type CDATA #IMPLIED
condition CDATA #IMPLIED
process-value (no | yes) #IMPLIED
>
>-->

<!ELEMENT g:postfix (g:ref | g:xref | g:optional | g:sequence | g:string)+>
<!--<!ELEMENT g:postfix (g:ref | g:xref | g:optional | g:sequence | g:string)+>
<!ATTLIST g:postfix
name ID #REQUIRED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
prefix-seq-type CDATA #IMPLIED
condition CDATA #IMPLIED
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
>
>-->

<!ELEMENT g:prefix (g:optional | g:ref | g:xref | g:choice | g:zeroOrMore | g:oneOrMore | g:sequence | g:next | g:string)+>
<!--<!ELEMENT g:prefix (g:optional | g:ref | g:xref | g:choice | g:zeroOrMore | g:oneOrMore | g:sequence | g:next | g:string)+>
<!ATTLIST g:prefix
name ID #REQUIRED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
prefix-seq-type CDATA "*"
condition CDATA #IMPLIED
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
>
>-->

<!-- This element is used in exprProduction to control where the next production
will be called from. If it is not used, the next production will automatically be
called.
-->
<!ELEMENT g:next EMPTY>
<!--<!ELEMENT g:next EMPTY>
<!ATTLIST g:next
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
>
>-->

<!ELEMENT g:primary (g:optional | g:ref | g:xref | g:choice |
<!--<!ELEMENT g:primary (g:optional | g:ref | g:xref | g:choice |
g:zeroOrMore | g:oneOrMore | g:sequence | g:string)+>
<!ATTLIST g:primary
name ID #REQUIRED
if IDREFS #IMPLIED
not-if IDREFS #IMPLIED
condition CDATA #IMPLIED
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
>
>-->

<!ELEMENT g:ref EMPTY>
<!ATTLIST g:ref
Expand Down
Loading
Loading