You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3195 Reporter: administrator Status: acknowledged Resolution: open Priority: normal Severity: feature Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
Full_Name: Per Larsson
Version: 3.08
OS: linux
Submission from: 1-1-8-41a.ens.sth.bostream.se (82.182.158.5)
The inclusion of the character set difference operator (#) was a nice extension
to ocamllex syntax. Now there remains to handle character set union!
For an illustration of the problem, consider the following example:
let lower = ['\097'-'\122' '\181' '\223'-'\246' '\248'-'\255']
let upper = ['\065'-'\090' '\192'-'\214' '\216'-'\222']
let graph = ['\033'-'\126' '\160'-'\255']
let alpha = lower | upper
...
Now you can't define a character set
let punct = graph # alnum INVALID!!
The reason is that the character set property is defined syntactically and
therefore excludeds 'alpha'. There seems to be at least two easy solutions to
the problem:
(1) Let (a | b) be a character set if a and b is
(2) Extend the [...] [^ ...] contexts to include items which are themselves
(names of) character sets, i.e. you should be allowed to write character sets in
the style:
let alpha = [lower upper]
let print = [^ cntrl]
let alnum = [alpha '\048'-'\057']
(IMHO, this second extension seems to be very natural and could be considered
even if the # operator hadn't accentuated the need. This is also the solution in
"ALEX" a lexer generator for haskell.)
Best regards
Per Larsson
The text was updated successfully, but these errors were encountered:
Original bug ID: 3195
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
Full_Name: Per Larsson
Version: 3.08
OS: linux
Submission from: 1-1-8-41a.ens.sth.bostream.se (82.182.158.5)
The inclusion of the character set difference operator (#) was a nice extension
to ocamllex syntax. Now there remains to handle character set union!
For an illustration of the problem, consider the following example:
let lower = ['\097'-'\122' '\181' '\223'-'\246' '\248'-'\255']
let upper = ['\065'-'\090' '\192'-'\214' '\216'-'\222']
let graph = ['\033'-'\126' '\160'-'\255']
let alpha = lower | upper
...
Now you can't define a character set
let punct = graph # alnum INVALID!!
The reason is that the character set property is defined syntactically and
therefore excludeds 'alpha'. There seems to be at least two easy solutions to
the problem:
(1) Let (a | b) be a character set if a and b is
(2) Extend the [...] [^ ...] contexts to include items which are themselves
(names of) character sets, i.e. you should be allowed to write character sets in
the style:
let alpha = [lower upper]
let print = [^ cntrl]
let alnum = [alpha '\048'-'\057']
(IMHO, this second extension seems to be very natural and could be considered
even if the # operator hadn't accentuated the need. This is also the solution in
"ALEX" a lexer generator for haskell.)
Best regards
Per Larsson
The text was updated successfully, but these errors were encountered: