[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Case sensivity & character sets



hi there,

--
Is there a way to change case-sensitive/case-insensitive parser
generation? The examples seem to be case insensitive, and also tokens in
my grammar seem to be case insensitive, so e.g.
having the definition for the token
Token 
 value = 'value';

all input like: 'value', 'VALUE', 'Value', etc is placed as AValue in the
AST.

--
Is there nice way to declare character sets? In my grammar I am about to
declare alpha helper, which should be a set of characters like:
! $ % & * + - . / < > _ ~

so I tried:

Helper
 alpha = ['!' + '$' + '%' + '&' ] ;


but it seems that + can accept only two arguments, so I ended up in
something awful like:

Helper
 alpha = [[[['!' + '$'] + ['%' + '&']] +
           [['*' + '+'] + ['-' + '.']]] +
           [[['/' + '<'] + '>'] + ['_' + '~']]];

it really does the job, but it is not the nicer construction, and
writing/checking/modifying it is a little bit painful.

Thanks very much in advance for the answers. 

------                     _  _   _  _   _    _
Mariusz Nowostawski  aka  / `'/ /-/ / ' / \/ /