I need a way to terminate a subrule
and allow the higher rule to start a new node. The subrule allows
the alternative "space number" but it appears to be stuck on
space and expecting it to be followed by a number. Grammatica issued
an error for unexpected token:
Note that "49" needs to be
included with the base number "1003.1-X" but the keyword "SUPP"
(abbreviation of SUPPLEMENT) needs to be in the suffix node. I realize
that you prefer to %ignore% the space character but it is needed to enable
references "MIL-STD-123-7 SUPP 1A" and "MIL-STD-123 SUPP
1A" (the impliedRev subrule handles the "-7" implied revision).
The grammar follows:
%header%
GRAMMARTYPE = "LL"
DESCRIPTION = "A grammar for translating
document number reference
into structured keys: family, revision, suffix,
etc."
delim =
<<[+=",':;!#$%&*<>address@hidden>>
fluff =
<<[\t\n\r\f\a\e]+>> %ignore% // do not explicitly handle unprintable
number =
<<[0-9]+>> // one or more digits
string =
<<[A-Z][A-Z]+>>
alpha =
<<[A-Z]>>