Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003195OCamltools (ocaml{lex,yacc,dep,debug,...})public2004-09-30 20:202013-11-05 15:52
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003195: ocamllex, FEATURE WISH
DescriptionFull_Name: Per Larsson
Version: 3.08
OS: linux
Submission from: (

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
2016-12-07 16:37 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser,debug}) => OCaml tools (ocaml{lex,yacc,dep,debug})
2017-02-23 16:45 doligez Category OCaml tools (ocaml{lex,yacc,dep,debug}) => tools (ocaml{lex,yacc,dep,debug,...})

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker