All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin.src.test.java.org.gradle.GrammarTest Maven / Gradle / Ivy

There is a newer version: 8.11.1
Show newest version
package org.gradle;

import java.io.StringReader;
import org.junit.Test;
import static org.junit.Assert.*;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.ANTLRStringStream;
public class GrammarTest {
    @Test
    public void canUseGeneratedGrammar() throws Exception {
        ANTLRStringStream in = new ANTLRStringStream("1+2");
        CalculatorLexer lexer = new CalculatorLexer(in);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        CalculatorParser parser = new CalculatorParser(tokens);
        parser.add();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy