Jlex question

pushVTEC

Senior member
Aug 30, 2003
265
0
0
I'm getting an unmatched input error, the file i'm running the test on just has 2+2 in it. The goal is to be able to add,subtract,divide,and multiply real numbers. My question is why am I getting the error, I was thinking it may have something to do with my regular expression for float since it worked fine on basic integers but once I threw that in there it didn't work.

Code
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
So you got it worked out? I took compilers only a year ago and most of that stuff is just gone from my head :p

As a side note, using == is really bad practice. It works for you there because all string matching literals are interned to the same object but you're asking for trouble. Unless you understood the risk and were just going for the performance boost over String.equals() :)