Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 03a94d8f913fd31140f11f39714fa79d > files > 20

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