Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > d6ed6c5147aa2cde3d48cc9fb4d84ac5 > files > 20

ant-antlr3-20110110-11.mga5.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();
        }
    }
}