Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > abc3709154006bddd98f4d8af5d9d690 > files > 20

ant-antlr3-20110110-3.fc14.noarch.rpm

package org.myorg.d2u;

import java.io.*;
import org.antlr.runtime.*;
import org.antlr.stringtemplate.*;
import org.antlr.stringtemplate.language.*;

public class Main {
    
    public static void main(String args[]) throws Exception {

        d2uLexer lex = new d2uLexer(new ANTLRInputStream(System.in));
        CommonTokenStream tokens = new CommonTokenStream(lex);
        d2uParser g = new d2uParser(tokens);
        StringTemplateGroup templates = new StringTemplateGroup(new FileReader("d2u.stg"), DefaultTemplateLexer.class);
        g.setTemplateLib(templates);
        
        if ( args.length > 0 ) {
           g.setNewline(args[0].toLowerCase());
        }
        
        try {
            g.lines();
        } catch (RecognitionException e) {
            e.printStackTrace();
        }
    }
}