Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003195OCamlOCaml tools (ocaml{lex,yacc,dep,browser,debug})public2004-09-30 20:202013-11-05 15:52
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003195: ocamllex, FEATURE WISH
DescriptionFull_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



TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2013-11-05 15:52 lpw25 Category OCaml general => OCaml tools (ocaml{lex,yacc,dep,browser,debug})
2013-11-05 15:52 lpw25 Description Updated View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker