[antlr-interest] Creating Lexer from String

Ted Villalba tedv at esrconsulting.com
Thu May 17 14:38:29 PDT 2007


Hi,
 
Can someone tell me how to create a Lexer from a String. My generated code
does not allow me to use StringReader, something I saw recommended in an
earlier post. 
 
When I compile I get:
Test.java:15: cannot find symbol
symbol  : constructor QLexer(java.io.StringReader)
location: class QLexer
        QLexer lexer = new QLexer(sr);
 
 
In the original generated Qlexer.java  file I only see:
public class QLexer extends Lexer {
    .
    public QLexer(CharStream input) {
        super(input);
}
 
Perhaps the answer is staring me in the face, but ( not being a Java expert
either)I am looking for, I think, a constructor that accepts a String as
input.
 
 
Thanks,
Ted
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070517/94d344b2/attachment.html 


More information about the antlr-interest mailing list