org.vesalainen.grammar.Eof Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lpg Show documentation
Show all versions of lpg Show documentation
Java Lookahead Parser Generator. Generator produces LALR(k) parsers. Grammar
rules are entered using annotations. Rule annotation can be attached to reducer
method, which keeps rule and it's action together.
The newest version!
package org.vesalainen.grammar;
import java.io.IOException;
import org.vesalainen.parser.util.HtmlPrinter;
import org.vesalainen.regex.Regex.Option;
public class Eof extends GTerminal
{
public Eof()
{
super(0, "Eof");
}
/**
* Makes terminal act like eof. This is used in sub-grammars.
* @param terminal
*/
Eof(int number, String name, String expression, int priority, int base, boolean whiteSpace, Option... options)
{
super(number, "Eof("+name+")", expression, priority, base, whiteSpace, "", options);
}
@Override
public boolean isEof()
{
return true;
}
@Override
public String toString()
{
return "Eof";
}
@Override
public void print(HtmlPrinter p) throws IOException
{
p.print("Eof");
}
}