[antlr-interest] Reading from Files vs Strings

Marc-André Laverdière ma_laver at ciise.concordia.ca
Tue May 1 11:18:46 PDT 2007


Hello,

I have an interesting bug.

I have a file to parse. Since I'm working on an IDE, I load it in memory 
as a String and I pass it to ANTLR to parse using:
ANTLRReaderStream input = new ANTLRReaderStream(new 
StringReader(dataToCompile));

And I'm getting a bunch of errors.
However, if I'm telling ANTLR to parse it as a file, using
ANTLRStringStream input= new ANTLRInputStream(new 
FileInputStream(fileName));
then things do parse well.

What am I doing wrong here?
Thanks in advance for the help!

-- 
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