[antlr-interest] Newbie Alert! Disabling the removal of whitespace in a rule

Marc-André Laverdière ma_laver at ciise.concordia.ca
Fri Mar 9 10:57:30 PST 2007


Hello folks,

I'm a newbie to Antlr, and I'm still trying to understand a lot of the 
basics... I hope you'll bear with me!

I have a rule as follows

sh_code_blob
	:	(.)* {greedy=false;};

It works OK, except for all the whitespace that is chopped off, 
resulting in a lot of tokens underneath sh_code_blob in the 
interpreter's tree. I'd like to have code blobs as one token.

Is there an option we can put (like the greedy above) that allows to 
disable the lexer's removal of white space? What other ways can I 
achieve my objective?

Thanks a lot!

-- 
Marc-André LAVERDIÈRE, B. Eng., M. A. Sc. (in progress)
Computer Security Laboratory - Laboratoire de sécurité informatique
CIISE, Université Concordia University, Montréal, Québec, Canada
www.ciise.concordia.ca

/"\
\ /    ASCII Ribbon Campaign
  X      against HTML e-mail
/ \

"Perseverance must finish its work so that you may be mature and 
complete, not lacking anything." -James 1:4


More information about the antlr-interest mailing list