com.inxar.syntacs.translator.regexp
Class RegexpGrammar

java.lang.Object
  |
  +--com.inxar.syntacs.translator.regexp.RegexpGrammar
All Implemented Interfaces:
LRTranslatorGrammar, Serializable, TranslatorGrammar

public class RegexpGrammar
extends Object
implements LRTranslatorGrammar

Automatically generated by Syntacs Translation Toolkit on Fri Jul 06 12:05:08 PDT 2001

# GRAMMAR
  DECLARATION
 this is regexp version 0.1.0;
 
 # PROPERTY DEFINITIONS
 property viz-namespace = "regexp";
 property viz-dpa-size = "20,20";
 property viz-syntactic = "true";
 property author-email = "pcj@inxar.org";
 property viz-dpa-concentrate-edges = "true";
 property author = "Paul Cody Johnston";
 property viz-dpa-hide-loopback-edges = "true";
 property compile-interpreter-classname =
  "com.inxar.syntacs.translator.regexp.RegexpInterpreter";
 property viz-sourcepath = "./grammar";
 property viz-dfa-size = "12,12";
 property viz-lexical = "true";
 property compile-namespace = "com.inxar.syntacs.translator.regexp";
 property compile-dpa-constructor-method = "LALR1";
 property compile-sourcepath = "./src";
 
 # TERMINAL DECLARATIONS
 terminal WHITESPACE;
 terminal CHAR;
 terminal CHAR_CLASS_CHAR;
 terminal PIPE;
 terminal STAR;
 terminal QUESTION;
 terminal PLUS;
 terminal OPEN_PAREN;
 terminal CLOSE_PAREN;
 terminal OPEN_BRACKET;
 terminal OPEN_BRACKET_CARET;
 terminal OPEN_BRACKET_DASH;
 terminal OPEN_BRACKET_CARET_DASH;
 terminal CLOSE_BRACKET;
 terminal CHAR_CLASS_DASH;
 terminal ESC;
 terminal ESC_OCTAL;
 terminal ESC_UNICODE;
 
 # TERMINAL DEFINITIONS
 WHITESPACE matches "(\t|\n|\v|\r|\s)+";
 CHAR matches "[^\\|()[\]*+?]";
 CHAR_CLASS_CHAR matches "[^-\]\\]";
 PIPE matches "\|";
 STAR matches "\*";
 QUESTION matches "\?";
 PLUS matches "\+";
 OPEN_PAREN matches "\(";
 CLOSE_PAREN matches "\)";
 OPEN_BRACKET matches "(\[(\t|\n|\v|\r|\s)*)";
 OPEN_BRACKET_CARET matches "(\[(\t|\n|\v|\r|\s)*^)";
 OPEN_BRACKET_DASH matches "(\[(\t|\n|\v|\r|\s)*-)";
 OPEN_BRACKET_CARET_DASH matches
  "(\[(\t|\n|\v|\r|\s)*^(\t|\n|\v|\r|\s)*-)";
 CLOSE_BRACKET matches "\]";
 CHAR_CLASS_DASH matches "(-)";
 ESC matches " \\ [^\t\n\v\r\s] ";
 ESC_OCTAL matches "(\\0[0-3][0-7][0-7])";
 ESC_UNICODE matches "(\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])";
 
 # NONTERMINAL DECLARATIONS
 nonterminal Goal;
 nonterminal Union;
 nonterminal Concat;
 nonterminal Term;
 nonterminal Quantifier;
 nonterminal Atom;
 nonterminal CharClass;
 nonterminal CharClassBegin;
 nonterminal CharClassTermList;
 nonterminal CharClassTerm;
 nonterminal CharClassAtom;
 
 # NONTERMINAL DEFINITIONS
 reduce Goal when Union;
 reduce Union when Concat;
 reduce Union when Union PIPE Concat;
 reduce Concat when Term;
 reduce Concat when Concat Term;
 reduce Term when Atom;
 reduce Term when Atom Quantifier;
 reduce Quantifier when STAR;
 reduce Quantifier when PLUS;
 reduce Quantifier when QUESTION;
 reduce Atom when CHAR;
 reduce Atom when ESC;
 reduce Atom when ESC_OCTAL;
 reduce Atom when ESC_UNICODE;
 reduce Atom when CharClass;
 reduce Atom when OPEN_PAREN Union CLOSE_PAREN;
 reduce CharClass when CharClassBegin CharClassTermList CLOSE_BRACKET;
 reduce CharClass when OPEN_BRACKET_CARET_DASH CLOSE_BRACKET;
 reduce CharClassBegin when OPEN_BRACKET;
 reduce CharClassBegin when OPEN_BRACKET_CARET;
 reduce CharClassBegin when OPEN_BRACKET_DASH;
 reduce CharClassBegin when OPEN_BRACKET_CARET_DASH;
 reduce CharClassTermList when CharClassTerm;
 reduce CharClassTermList when CharClassTermList CharClassTerm;
 reduce CharClassTerm when CharClassAtom;
 reduce CharClassTerm when CharClassAtom CHAR_CLASS_DASH CharClassAtom;
 reduce CharClassAtom when CHAR_CLASS_CHAR;
 reduce CharClassAtom when ESC;
 reduce CharClassAtom when ESC_OCTAL;
 reduce CharClassAtom when ESC_UNICODE;
 
 accept when Goal;
 
 # CONTEXT DECLARATIONS
 context default;
 context charclass;
 
 # CONTEXT DEFINITIONS
 default includes WHITESPACE, CHAR, PIPE, STAR, QUESTION, PLUS, OPEN_PAREN,
  CLOSE_PAREN, ESC, ESC_OCTAL, ESC_UNICODE, OPEN_BRACKET shifts charclass,
  OPEN_BRACKET_CARET shifts charclass, OPEN_BRACKET_DASH shifts charclass,
  OPEN_BRACKET_CARET_DASH shifts charclass;
 charclass includes WHITESPACE, CHAR_CLASS_CHAR, CHAR_CLASS_DASH, ESC,
  ESC_OCTAL, ESC_UNICODE, CLOSE_BRACKET unshifts;
 
 start in context default;
 
 

See Also:
Serialized Form

Field Summary
static int C_charclass
          Constant ID for charclass
static int C_default
          Constant ID for default
static int N_Atom
          NonTerminal ID for Atom
static int N_CharClass
          NonTerminal ID for CharClass
static int N_CharClassAtom
          NonTerminal ID for CharClassAtom
static int N_CharClassBegin
          NonTerminal ID for CharClassBegin
static int N_CharClassTerm
          NonTerminal ID for CharClassTerm
static int N_CharClassTermList
          NonTerminal ID for CharClassTermList
static int N_Concat
          NonTerminal ID for Concat
static int N_Goal
          NonTerminal ID for Goal
static int N_Quantifier
          NonTerminal ID for Quantifier
static int N_Term
          NonTerminal ID for Term
static int N_Union
          NonTerminal ID for Union
static int P_Atom__CHAR
          Production ID for Atom__CHAR
static int P_Atom__CharClass
          Production ID for Atom__CharClass
static int P_Atom__ESC
          Production ID for Atom__ESC
static int P_Atom__ESC_OCTAL
          Production ID for Atom__ESC_OCTAL
static int P_Atom__ESC_UNICODE
          Production ID for Atom__ESC_UNICODE
static int P_Atom__OPEN_PAREN_Union_CLOSE_PAREN
          Production ID for Atom__OPEN_PAREN_Union_CLOSE_PAREN
static int P_CharClass__CharClassBegin_CharClassTermList_CLOSE_BRACKET
          Production ID for CharClass__CharClassBegin_CharClassTermList_CLOSE_BRACKET
static int P_CharClass__OPEN_BRACKET_CARET_DASH_CLOSE_BRACKET
          Production ID for CharClass__OPEN_BRACKET_CARET_DASH_CLOSE_BRACKET
static int P_CharClassAtom__CHAR_CLASS_CHAR
          Production ID for CharClassAtom__CHAR_CLASS_CHAR
static int P_CharClassAtom__ESC
          Production ID for CharClassAtom__ESC
static int P_CharClassAtom__ESC_OCTAL
          Production ID for CharClassAtom__ESC_OCTAL
static int P_CharClassAtom__ESC_UNICODE
          Production ID for CharClassAtom__ESC_UNICODE
static int P_CharClassBegin__OPEN_BRACKET
          Production ID for CharClassBegin__OPEN_BRACKET
static int P_CharClassBegin__OPEN_BRACKET_CARET
          Production ID for CharClassBegin__OPEN_BRACKET_CARET
static int P_CharClassBegin__OPEN_BRACKET_CARET_DASH
          Production ID for CharClassBegin__OPEN_BRACKET_CARET_DASH
static int P_CharClassBegin__OPEN_BRACKET_DASH
          Production ID for CharClassBegin__OPEN_BRACKET_DASH
static int P_CharClassTerm__CharClassAtom
          Production ID for CharClassTerm__CharClassAtom
static int P_CharClassTerm__CharClassAtom_CHAR_CLASS_DASH_CharClassAtom
          Production ID for CharClassTerm__CharClassAtom_CHAR_CLASS_DASH_CharClassAtom
static int P_CharClassTermList__CharClassTerm
          Production ID for CharClassTermList__CharClassTerm
static int P_CharClassTermList__CharClassTermList_CharClassTerm
          Production ID for CharClassTermList__CharClassTermList_CharClassTerm
static int P_Concat__Concat_Term
          Production ID for Concat__Concat_Term
static int P_Concat__Term
          Production ID for Concat__Term
static int P_Goal__Union
          Production ID for Goal__Union
static int P_Quantifier__PLUS
          Production ID for Quantifier__PLUS
static int P_Quantifier__QUESTION
          Production ID for Quantifier__QUESTION
static int P_Quantifier__STAR
          Production ID for Quantifier__STAR
static int P_Term__Atom
          Production ID for Term__Atom
static int P_Term__Atom_Quantifier
          Production ID for Term__Atom_Quantifier
static int P_Union__Concat
          Production ID for Union__Concat
static int P_Union__Union_PIPE_Concat
          Production ID for Union__Union_PIPE_Concat
static int T_CHAR
          Terminal ID for CHAR
static int T_CHAR_CLASS_CHAR
          Terminal ID for CHAR_CLASS_CHAR
static int T_CHAR_CLASS_DASH
          Terminal ID for CHAR_CLASS_DASH
static int T_CLOSE_BRACKET
          Terminal ID for CLOSE_BRACKET
static int T_CLOSE_PAREN
          Terminal ID for CLOSE_PAREN
static int T_ESC
          Terminal ID for ESC
static int T_ESC_OCTAL
          Terminal ID for ESC_OCTAL
static int T_ESC_UNICODE
          Terminal ID for ESC_UNICODE
static int T_OPEN_BRACKET
          Terminal ID for OPEN_BRACKET
static int T_OPEN_BRACKET_CARET
          Terminal ID for OPEN_BRACKET_CARET
static int T_OPEN_BRACKET_CARET_DASH
          Terminal ID for OPEN_BRACKET_CARET_DASH
static int T_OPEN_BRACKET_DASH
          Terminal ID for OPEN_BRACKET_DASH
static int T_OPEN_PAREN
          Terminal ID for OPEN_PAREN
static int T_PIPE
          Terminal ID for PIPE
static int T_PLUS
          Terminal ID for PLUS
static int T_QUESTION
          Terminal ID for QUESTION
static int T_STAR
          Terminal ID for STAR
static int T_WHITESPACE
          Terminal ID for WHITESPACE
 
Fields inherited from interface org.inxar.syntacs.translator.lr.LRTranslatorGrammar
ACTION_PEEK, ACTION_PEEL, ACTION_POP, ACTION_POUNCE, ACTION_PUSH, UNDEFINED, UNDEFINED_CONTEXT, UNDEFINED_NONTERMINAL, UNDEFINED_PRODUCTION, UNDEFINED_SYMBOL, UNDEFINED_TERMINAL
 
Constructor Summary
RegexpGrammar()
           
 
Method Summary
 String getContext(int ID)
          Returns the name of the context having the given ID or null if no such ID is known.
 int getContextAction(int cID, int tID)
          Returns the action defined for the given grammar symbol in the given context as one of the ACTION_XXX constants in this interface.
 int getContextRegister(int cID, int tID)
          Returns an integer stored at the value of the given contextID and symbolID.
 IntArray getContexts()
          Returns the list of context ID numbers as an IntArray.
 IntArray getContextTerminals(int ID)
          Returns a list of terminals defined within the context having the given ID or null if no such ID is known.
 int getGoalNonTerminal()
          Returns the ID of the goal symbol (a nonterminal) or UNDEFINED_NONTERMINAL is no such goal symbol has been set.
 String getName()
          Returns the name of the Translator.
 String getNonTerminal(int ID)
          Returns the name of the nonterminal having the given ID or null if no such ID is known.
 IntArray getNonTerminals()
          Returns the list of nonterminal ID numbers as an IntArray.
 String getProduction(int ID)
          Returns the name of the production having the given ID or null if no such ID is known.
 int getProductionLength(int ID)
          Returns the length of the list of grammar symbols of the right-hand-side of the production having the given ID or UNDEFINED_PRODUCTION if no such ID is known.
 int getProductionNonTerminal(int ID)
          Returns the ID of the nonterminal obtained by reduction of the given productionID or UNDEFINED_PRODUCTION if no such production is known.
 IntArray getProductions()
          Returns the list of production ID numbers as an IntArray.
 IntArray getProductionSymbols(int ID)
          Returns the list of grammar symbols of the right-hand-side of the production having the given ID as an IntArray or null if no such ID is known.
 int getStartContext()
          Returns the ID of the initial context.
 String getTerminal(int ID)
          Returns the name of the terminal having the given ID or null if no such ID is known.
 IntArray getTerminalContexts(int ID)
          Returns a list of contexts in which this terminal is defined.
 Object getTerminalRegexp(int ID)
          Returns the regular expression String for the terminal having the given ID or null if no such ID is known.
 IntArray getTerminals()
          Returns the list of terminal ID numbers as an IntArray.
 String getVersion()
          Returns the version number given to this grammar.
 Translator newTranslator()
          Returns a new Translator for this TranslatorGrammar having some default set of properties.
 Translator newTranslator(Properties p)
          Returns a new Translator for this TranslatorGrammar using the given Properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C_default

public static final int C_default
Constant ID for default

C_charclass

public static final int C_charclass
Constant ID for charclass

T_WHITESPACE

public static final int T_WHITESPACE
Terminal ID for WHITESPACE

T_CHAR

public static final int T_CHAR
Terminal ID for CHAR

T_CHAR_CLASS_CHAR

public static final int T_CHAR_CLASS_CHAR
Terminal ID for CHAR_CLASS_CHAR

T_PIPE

public static final int T_PIPE
Terminal ID for PIPE

T_STAR

public static final int T_STAR
Terminal ID for STAR

T_QUESTION

public static final int T_QUESTION
Terminal ID for QUESTION

T_PLUS

public static final int T_PLUS
Terminal ID for PLUS

T_OPEN_PAREN

public static final int T_OPEN_PAREN
Terminal ID for OPEN_PAREN

T_CLOSE_PAREN

public static final int T_CLOSE_PAREN
Terminal ID for CLOSE_PAREN

T_OPEN_BRACKET

public static final int T_OPEN_BRACKET
Terminal ID for OPEN_BRACKET

T_OPEN_BRACKET_CARET

public static final int T_OPEN_BRACKET_CARET
Terminal ID for OPEN_BRACKET_CARET

T_OPEN_BRACKET_DASH

public static final int T_OPEN_BRACKET_DASH
Terminal ID for OPEN_BRACKET_DASH

T_OPEN_BRACKET_CARET_DASH

public static final int T_OPEN_BRACKET_CARET_DASH
Terminal ID for OPEN_BRACKET_CARET_DASH

T_CLOSE_BRACKET

public static final int T_CLOSE_BRACKET
Terminal ID for CLOSE_BRACKET

T_CHAR_CLASS_DASH

public static final int T_CHAR_CLASS_DASH
Terminal ID for CHAR_CLASS_DASH

T_ESC

public static final int T_ESC
Terminal ID for ESC

T_ESC_OCTAL

public static final int T_ESC_OCTAL
Terminal ID for ESC_OCTAL

T_ESC_UNICODE

public static final int T_ESC_UNICODE
Terminal ID for ESC_UNICODE

N_Goal

public static final int N_Goal
NonTerminal ID for Goal

N_Union

public static final int N_Union
NonTerminal ID for Union

N_Concat

public static final int N_Concat
NonTerminal ID for Concat

N_Term

public static final int N_Term
NonTerminal ID for Term

N_Quantifier

public static final int N_Quantifier
NonTerminal ID for Quantifier

N_Atom

public static final int N_Atom
NonTerminal ID for Atom

N_CharClass

public static final int N_CharClass
NonTerminal ID for CharClass

N_CharClassBegin

public static final int N_CharClassBegin
NonTerminal ID for CharClassBegin

N_CharClassTermList

public static final int N_CharClassTermList
NonTerminal ID for CharClassTermList

N_CharClassTerm

public static final int N_CharClassTerm
NonTerminal ID for CharClassTerm

N_CharClassAtom

public static final int N_CharClassAtom
NonTerminal ID for CharClassAtom

P_Goal__Union

public static final int P_Goal__Union
Production ID for Goal__Union

P_Union__Concat

public static final int P_Union__Concat
Production ID for Union__Concat

P_Union__Union_PIPE_Concat

public static final int P_Union__Union_PIPE_Concat
Production ID for Union__Union_PIPE_Concat

P_Concat__Term

public static final int P_Concat__Term
Production ID for Concat__Term

P_Concat__Concat_Term

public static final int P_Concat__Concat_Term
Production ID for Concat__Concat_Term

P_Term__Atom

public static final int P_Term__Atom
Production ID for Term__Atom

P_Term__Atom_Quantifier

public static final int P_Term__Atom_Quantifier
Production ID for Term__Atom_Quantifier

P_Quantifier__STAR

public static final int P_Quantifier__STAR
Production ID for Quantifier__STAR

P_Quantifier__PLUS

public static final int P_Quantifier__PLUS
Production ID for Quantifier__PLUS

P_Quantifier__QUESTION

public static final int P_Quantifier__QUESTION
Production ID for Quantifier__QUESTION

P_Atom__CHAR

public static final int P_Atom__CHAR
Production ID for Atom__CHAR

P_Atom__ESC

public static final int P_Atom__ESC
Production ID for Atom__ESC

P_Atom__ESC_OCTAL

public static final int P_Atom__ESC_OCTAL
Production ID for Atom__ESC_OCTAL

P_Atom__ESC_UNICODE

public static final int P_Atom__ESC_UNICODE
Production ID for Atom__ESC_UNICODE

P_Atom__CharClass

public static final int P_Atom__CharClass
Production ID for Atom__CharClass

P_Atom__OPEN_PAREN_Union_CLOSE_PAREN

public static final int P_Atom__OPEN_PAREN_Union_CLOSE_PAREN
Production ID for Atom__OPEN_PAREN_Union_CLOSE_PAREN

P_CharClass__CharClassBegin_CharClassTermList_CLOSE_BRACKET

public static final int P_CharClass__CharClassBegin_CharClassTermList_CLOSE_BRACKET
Production ID for CharClass__CharClassBegin_CharClassTermList_CLOSE_BRACKET

P_CharClass__OPEN_BRACKET_CARET_DASH_CLOSE_BRACKET

public static final int P_CharClass__OPEN_BRACKET_CARET_DASH_CLOSE_BRACKET
Production ID for CharClass__OPEN_BRACKET_CARET_DASH_CLOSE_BRACKET

P_CharClassBegin__OPEN_BRACKET

public static final int P_CharClassBegin__OPEN_BRACKET
Production ID for CharClassBegin__OPEN_BRACKET

P_CharClassBegin__OPEN_BRACKET_CARET

public static final int P_CharClassBegin__OPEN_BRACKET_CARET
Production ID for CharClassBegin__OPEN_BRACKET_CARET

P_CharClassBegin__OPEN_BRACKET_DASH

public static final int P_CharClassBegin__OPEN_BRACKET_DASH
Production ID for CharClassBegin__OPEN_BRACKET_DASH

P_CharClassBegin__OPEN_BRACKET_CARET_DASH

public static final int P_CharClassBegin__OPEN_BRACKET_CARET_DASH
Production ID for CharClassBegin__OPEN_BRACKET_CARET_DASH

P_CharClassTermList__CharClassTerm

public static final int P_CharClassTermList__CharClassTerm
Production ID for CharClassTermList__CharClassTerm

P_CharClassTermList__CharClassTermList_CharClassTerm

public static final int P_CharClassTermList__CharClassTermList_CharClassTerm
Production ID for CharClassTermList__CharClassTermList_CharClassTerm

P_CharClassTerm__CharClassAtom

public static final int P_CharClassTerm__CharClassAtom
Production ID for CharClassTerm__CharClassAtom

P_CharClassTerm__CharClassAtom_CHAR_CLASS_DASH_CharClassAtom

public static final int P_CharClassTerm__CharClassAtom_CHAR_CLASS_DASH_CharClassAtom
Production ID for CharClassTerm__CharClassAtom_CHAR_CLASS_DASH_CharClassAtom

P_CharClassAtom__CHAR_CLASS_CHAR

public static final int P_CharClassAtom__CHAR_CLASS_CHAR
Production ID for CharClassAtom__CHAR_CLASS_CHAR

P_CharClassAtom__ESC

public static final int P_CharClassAtom__ESC
Production ID for CharClassAtom__ESC

P_CharClassAtom__ESC_OCTAL

public static final int P_CharClassAtom__ESC_OCTAL
Production ID for CharClassAtom__ESC_OCTAL

P_CharClassAtom__ESC_UNICODE

public static final int P_CharClassAtom__ESC_UNICODE
Production ID for CharClassAtom__ESC_UNICODE
Constructor Detail

RegexpGrammar

public RegexpGrammar()
Method Detail

getContext

public String getContext(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the name of the context having the given ID or null if no such ID is known.
Specified by:
getContext in interface LRTranslatorGrammar

getContextAction

public int getContextAction(int cID,
                            int tID)
Description copied from interface: LRTranslatorGrammar
Returns the action defined for the given grammar symbol in the given context as one of the ACTION_XXX constants in this interface. If the contextID or symbolID is not known, UNDEFINED_CONTEXT or UNDEFINED_SYMBOL will be returned. Note: If UNDEFINED_SYMBOL is returned the ID may still be a valid terminal or nonterminal, but it not a member of the given context.
Specified by:
getContextAction in interface LRTranslatorGrammar

getContextRegister

public int getContextRegister(int cID,
                              int tID)
Description copied from interface: LRTranslatorGrammar
Returns an integer stored at the value of the given contextID and symbolID. This is used in conjunction with getContextAction(int, int) such that the second member in the tuple (action, register) is returned. If the contextID or symbolID is not known, UNDEFINED_CONTEXT or UNDEFINED_SYMBOL will be returned.
Specified by:
getContextRegister in interface LRTranslatorGrammar

getContextTerminals

public IntArray getContextTerminals(int ID)
Description copied from interface: LRTranslatorGrammar
Returns a list of terminals defined within the context having the given ID or null if no such ID is known.
Specified by:
getContextTerminals in interface LRTranslatorGrammar

getContexts

public IntArray getContexts()
Description copied from interface: LRTranslatorGrammar
Returns the list of context ID numbers as an IntArray.
Specified by:
getContexts in interface LRTranslatorGrammar

getGoalNonTerminal

public int getGoalNonTerminal()
Description copied from interface: LRTranslatorGrammar
Returns the ID of the goal symbol (a nonterminal) or UNDEFINED_NONTERMINAL is no such goal symbol has been set.
Specified by:
getGoalNonTerminal in interface LRTranslatorGrammar

getName

public String getName()
Description copied from interface: TranslatorGrammar
Returns the name of the Translator.
Specified by:
getName in interface TranslatorGrammar

getNonTerminal

public String getNonTerminal(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the name of the nonterminal having the given ID or null if no such ID is known.
Specified by:
getNonTerminal in interface LRTranslatorGrammar

getNonTerminals

public IntArray getNonTerminals()
Description copied from interface: LRTranslatorGrammar
Returns the list of nonterminal ID numbers as an IntArray.
Specified by:
getNonTerminals in interface LRTranslatorGrammar

getProduction

public String getProduction(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the name of the production having the given ID or null if no such ID is known. The String has the format "nonterminal: sym1 sym2 sym3" such that the nonterminal name is the first part of the string, followed by a colon, followed by a space delimited list of symbols.
Specified by:
getProduction in interface LRTranslatorGrammar

getProductionLength

public int getProductionLength(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the length of the list of grammar symbols of the right-hand-side of the production having the given ID or UNDEFINED_PRODUCTION if no such ID is known.
Specified by:
getProductionLength in interface LRTranslatorGrammar

getProductionNonTerminal

public int getProductionNonTerminal(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the ID of the nonterminal obtained by reduction of the given productionID or UNDEFINED_PRODUCTION if no such production is known.
Specified by:
getProductionNonTerminal in interface LRTranslatorGrammar

getProductionSymbols

public IntArray getProductionSymbols(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the list of grammar symbols of the right-hand-side of the production having the given ID as an IntArray or null if no such ID is known.
Specified by:
getProductionSymbols in interface LRTranslatorGrammar

getProductions

public IntArray getProductions()
Description copied from interface: LRTranslatorGrammar
Returns the list of production ID numbers as an IntArray.
Specified by:
getProductions in interface LRTranslatorGrammar

getStartContext

public int getStartContext()
Description copied from interface: LRTranslatorGrammar
Returns the ID of the initial context.
Specified by:
getStartContext in interface LRTranslatorGrammar

getTerminal

public String getTerminal(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the name of the terminal having the given ID or null if no such ID is known.
Specified by:
getTerminal in interface LRTranslatorGrammar

getTerminalContexts

public IntArray getTerminalContexts(int ID)
Description copied from interface: LRTranslatorGrammar
Returns a list of contexts in which this terminal is defined.
Specified by:
getTerminalContexts in interface LRTranslatorGrammar

getTerminalRegexp

public Object getTerminalRegexp(int ID)
Description copied from interface: LRTranslatorGrammar
Returns the regular expression String for the terminal having the given ID or null if no such ID is known. If the terminal ID is valid but no definition has been provided for that terminal, the empty string "" will be returned.
Specified by:
getTerminalRegexp in interface LRTranslatorGrammar

getTerminals

public IntArray getTerminals()
Description copied from interface: LRTranslatorGrammar
Returns the list of terminal ID numbers as an IntArray.
Specified by:
getTerminals in interface LRTranslatorGrammar

getVersion

public String getVersion()
Description copied from interface: TranslatorGrammar
Returns the version number given to this grammar.
Specified by:
getVersion in interface TranslatorGrammar

newTranslator

public Translator newTranslator()
Description copied from interface: TranslatorGrammar
Returns a new Translator for this TranslatorGrammar having some default set of properties.
Specified by:
newTranslator in interface TranslatorGrammar

newTranslator

public Translator newTranslator(Properties p)
Description copied from interface: TranslatorGrammar
Returns a new Translator for this TranslatorGrammar using the given Properties. The names and values of the elements in the Properties may be used to modify or communicate with the internals of the Translator instance (such as turning on debugging). The specifics reagarding the names and values of the properties are specific to the translator itself and need be documented elsewhere.
Specified by:
newTranslator in interface TranslatorGrammar