Hi,all

I want to convert the token stream into upper case at the time when lexical
rules are checked.

In java, we can do it in this way:
<pre>
public class ANTLRNoCaseStringStream extends ANTLRStringStream {
    public ANTLRNoCaseStringStream(String input) {
        super(input);
    }

    @Override
    public int LA(int i) {
        int returnChar = super.LA(i);
        if (returnChar == CharStream.EOF) {
            return returnChar;
        } else if (returnChar == 0) {
            return returnChar;
        }
        return Character.toUpperCase((char) returnChar);
    }
}
</pre>

then,
<pre>
// assume that we are going to make a SQL parser.
SQLLexer lexer = new SQLLexer(new ANTLRNoCaseStringStream(command))
</pre>

But, my question is that: how to do the same thing in C program?
I looked into antlr3 C runtime source, but could not find a way to archive
this.
In fact, I'm a java programmer, new to C, the source code really confused me
 >_<

By the way, could you figure out any open sourced C project that using
antlr3?

Thank you in advance.

-- 
金杰

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to