com.inxar.syntacs.translator.syntacs
Class SyntacsGrammar

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

public class SyntacsGrammar
extends Object
implements LRTranslatorGrammar

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

# GRAMMAR
  DECLARATION
 this is syntacs version 0.1.0;
 
 # PROPERTY DEFINITIONS
 property viz-namespace = "syntacs";
 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 = "false";
 property compile-interpreter-classname =
  "com.inxar.syntacs.translator.syntacs.SyntacsInterpreter";
 property viz-sourcepath = "./grammar";
 property viz-dfa-size = "12,12";
 property viz-dfa-rankdir = "TB";
 property viz-lexical = "true";
 property compile-namespace = "com.inxar.syntacs.translator.syntacs";
 property compile-dpa-constructor-method = "LALR1";
 property compile-sourcepath = "./src";
 
 # TERMINAL DECLARATIONS
 terminal COMMENT;
 terminal WHITESPACE;
 terminal THIS;
 terminal IS;
 terminal VERSION;
 terminal START;
 terminal IN;
 terminal CONTEXT;
 terminal TERMINAL;
 terminal NONTERMINAL;
 terminal REDUCE;
 terminal INCLUDES;
 terminal WHEN;
 terminal SHIFTS;
 terminal UNSHIFTS;
 terminal ACCEPT;
 terminal PROPERTY;
 terminal MATCHES;
 terminal IDENT;
 terminal STRING;
 terminal VERSION_STRING;
 terminal COMMA;
 terminal SEMI;
 terminal EQUALS;
 
 # TERMINAL DEFINITIONS
 COMMENT matches "(#[^\n\r]*(\n|(\r\n)))";
 WHITESPACE matches "(\t|\n|\v|\r|\s)+";
 IDENT matches "([_a-zA-Z][-_a-zA-Z0-9]*)";
 STRING matches "((\")([^\"\\]|(\\[^\n]))*(\"))";
 VERSION_STRING matches "([0-9]+.[0-9]+.[0-9]+)";
 COMMA matches ",";
 SEMI matches "\;";
 EQUALS matches "=";
 
 # NONTERMINAL DECLARATIONS
 nonterminal Goal;
 nonterminal Statement;
 nonterminal ThisIsStatement;
 nonterminal TerminalStatement;
 nonterminal MatchesStatement;
 nonterminal ContextStatement;
 nonterminal StartInStatement;
 nonterminal IncludesStatement;
 nonterminal NonterminalStatement;
 nonterminal ReduceStatement;
 nonterminal AcceptWhenStatement;
 nonterminal PropertyStatement;
 nonterminal StatementList;
 nonterminal InstructionList;
 nonterminal NonterminalList;
 nonterminal IdentList;
 nonterminal Instruction;
 
 # NONTERMINAL DEFINITIONS
 reduce Goal when ThisIsStatement StatementList;
 reduce StatementList when Statement;
 reduce StatementList when StatementList Statement;
 reduce Statement when TerminalStatement;
 reduce Statement when MatchesStatement;
 reduce Statement when ContextStatement;
 reduce Statement when StartInStatement;
 reduce Statement when IncludesStatement;
 reduce Statement when NonterminalStatement;
 reduce Statement when ReduceStatement;
 reduce Statement when AcceptWhenStatement;
 reduce Statement when PropertyStatement;
 reduce ThisIsStatement when THIS IS IDENT VERSION VERSION_STRING SEMI;
 reduce TerminalStatement when TERMINAL IdentList SEMI;
 reduce MatchesStatement when IDENT MATCHES STRING SEMI;
 reduce NonterminalStatement when NONTERMINAL IdentList SEMI;
 reduce ContextStatement when CONTEXT IdentList SEMI;
 reduce StartInStatement when START IN CONTEXT IDENT SEMI;
 reduce IncludesStatement when IDENT INCLUDES InstructionList SEMI;
 reduce ReduceStatement when REDUCE IDENT WHEN NonterminalList SEMI;
 reduce AcceptWhenStatement when ACCEPT WHEN IDENT SEMI;
 reduce PropertyStatement when PROPERTY IDENT EQUALS STRING SEMI;
 reduce IdentList when IDENT;
 reduce IdentList when IdentList COMMA IDENT;
 reduce NonterminalList when IDENT;
 reduce NonterminalList when NonterminalList IDENT;
 reduce InstructionList when Instruction;
 reduce InstructionList when InstructionList COMMA Instruction;
 reduce Instruction when IDENT;
 reduce Instruction when IDENT SHIFTS IDENT;
 reduce Instruction when IDENT UNSHIFTS;
 
 accept when Goal;
 
 # CONTEXT DECLARATIONS
 context default;
 
 # CONTEXT DEFINITIONS
 default includes COMMENT, WHITESPACE, IDENT, STRING, VERSION_STRING, COMMA,
  SEMI, EQUALS;
 
 start in context default;
 
 

See Also:
Serialized Form

Field Summary
static int C_default
          Constant ID for default
static int N_AcceptWhenStatement
          NonTerminal ID for AcceptWhenStatement
static int N_ContextStatement
          NonTerminal ID for ContextStatement
static int N_Goal
          NonTerminal ID for Goal
static int N_IdentList
          NonTerminal ID for IdentList
static int N_IncludesStatement
          NonTerminal ID for IncludesStatement
static int N_Instruction
          NonTerminal ID for Instruction
static int N_InstructionList
          NonTerminal ID for InstructionList
static int N_MatchesStatement
          NonTerminal ID for MatchesStatement
static int N_NonterminalList
          NonTerminal ID for NonterminalList
static int N_NonterminalStatement
          NonTerminal ID for NonterminalStatement
static int N_PropertyStatement
          NonTerminal ID for PropertyStatement
static int N_ReduceStatement
          NonTerminal ID for ReduceStatement
static int N_StartInStatement
          NonTerminal ID for StartInStatement
static int N_Statement
          NonTerminal ID for Statement
static int N_StatementList
          NonTerminal ID for StatementList
static int N_TerminalStatement
          NonTerminal ID for TerminalStatement
static int N_ThisIsStatement
          NonTerminal ID for ThisIsStatement
static int P_AcceptWhenStatement__ACCEPT_WHEN_IDENT_SEMI
          Production ID for AcceptWhenStatement__ACCEPT_WHEN_IDENT_SEMI
static int P_ContextStatement__CONTEXT_IdentList_SEMI
          Production ID for ContextStatement__CONTEXT_IdentList_SEMI
static int P_Goal__ThisIsStatement_StatementList
          Production ID for Goal__ThisIsStatement_StatementList
static int P_IdentList__IDENT
          Production ID for IdentList__IDENT
static int P_IdentList__IdentList_COMMA_IDENT
          Production ID for IdentList__IdentList_COMMA_IDENT
static int P_IncludesStatement__IDENT_INCLUDES_InstructionList_SEMI
          Production ID for IncludesStatement__IDENT_INCLUDES_InstructionList_SEMI
static int P_Instruction__IDENT
          Production ID for Instruction__IDENT
static int P_Instruction__IDENT_SHIFTS_IDENT
          Production ID for Instruction__IDENT_SHIFTS_IDENT
static int P_Instruction__IDENT_UNSHIFTS
          Production ID for Instruction__IDENT_UNSHIFTS
static int P_InstructionList__Instruction
          Production ID for InstructionList__Instruction
static int P_InstructionList__InstructionList_COMMA_Instruction
          Production ID for InstructionList__InstructionList_COMMA_Instruction
static int P_MatchesStatement__IDENT_MATCHES_STRING_SEMI
          Production ID for MatchesStatement__IDENT_MATCHES_STRING_SEMI
static int P_NonterminalList__IDENT
          Production ID for NonterminalList__IDENT
static int P_NonterminalList__NonterminalList_IDENT
          Production ID for NonterminalList__NonterminalList_IDENT
static int P_NonterminalStatement__NONTERMINAL_IdentList_SEMI
          Production ID for NonterminalStatement__NONTERMINAL_IdentList_SEMI
static int P_PropertyStatement__PROPERTY_IDENT_EQUALS_STRING_SEMI
          Production ID for PropertyStatement__PROPERTY_IDENT_EQUALS_STRING_SEMI
static int P_ReduceStatement__REDUCE_IDENT_WHEN_NonterminalList_SEMI
          Production ID for ReduceStatement__REDUCE_IDENT_WHEN_NonterminalList_SEMI
static int P_StartInStatement__START_IN_CONTEXT_IDENT_SEMI
          Production ID for StartInStatement__START_IN_CONTEXT_IDENT_SEMI
static int P_Statement__AcceptWhenStatement
          Production ID for Statement__AcceptWhenStatement
static int P_Statement__ContextStatement
          Production ID for Statement__ContextStatement
static int P_Statement__IncludesStatement
          Production ID for Statement__IncludesStatement
static int P_Statement__MatchesStatement
          Production ID for Statement__MatchesStatement
static int P_Statement__NonterminalStatement
          Production ID for Statement__NonterminalStatement
static int P_Statement__PropertyStatement
          Production ID for Statement__PropertyStatement
static int P_Statement__ReduceStatement
          Production ID for Statement__ReduceStatement
static int P_Statement__StartInStatement
          Production ID for Statement__StartInStatement
static int P_Statement__TerminalStatement
          Production ID for Statement__TerminalStatement
static int P_StatementList__Statement
          Production ID for StatementList__Statement
static int P_StatementList__StatementList_Statement
          Production ID for StatementList__StatementList_Statement
static int P_TerminalStatement__TERMINAL_IdentList_SEMI
          Production ID for TerminalStatement__TERMINAL_IdentList_SEMI
static int P_ThisIsStatement__THIS_IS_IDENT_VERSION_VERSION_STRING_SEMI
          Production ID for ThisIsStatement__THIS_IS_IDENT_VERSION_VERSION_STRING_SEMI
static int T_ACCEPT
          Terminal ID for ACCEPT
static int T_COMMA
          Terminal ID for COMMA
static int T_COMMENT
          Terminal ID for COMMENT
static int T_CONTEXT
          Terminal ID for CONTEXT
static int T_EQUALS
          Terminal ID for EQUALS
static int T_IDENT
          Terminal ID for IDENT
static int T_IN
          Terminal ID for IN
static int T_INCLUDES
          Terminal ID for INCLUDES
static int T_IS
          Terminal ID for IS
static int T_MATCHES
          Terminal ID for MATCHES
static int T_NONTERMINAL
          Terminal ID for NONTERMINAL
static int T_PROPERTY
          Terminal ID for PROPERTY
static int T_REDUCE
          Terminal ID for REDUCE
static int T_SEMI
          Terminal ID for SEMI
static int T_SHIFTS
          Terminal ID for SHIFTS
static int T_START
          Terminal ID for START
static int T_STRING
          Terminal ID for STRING
static int T_TERMINAL
          Terminal ID for TERMINAL
static int T_THIS
          Terminal ID for THIS
static int T_UNSHIFTS
          Terminal ID for UNSHIFTS
static int T_VERSION
          Terminal ID for VERSION
static int T_VERSION_STRING
          Terminal ID for VERSION_STRING
static int T_WHEN
          Terminal ID for WHEN
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
SyntacsGrammar()
           
 
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

T_COMMENT

public static final int T_COMMENT
Terminal ID for COMMENT

T_WHITESPACE

public static final int T_WHITESPACE
Terminal ID for WHITESPACE

T_THIS

public static final int T_THIS
Terminal ID for THIS

T_IS

public static final int T_IS
Terminal ID for IS

T_VERSION

public static final int T_VERSION
Terminal ID for VERSION

T_START

public static final int T_START
Terminal ID for START

T_IN

public static final int T_IN
Terminal ID for IN

T_CONTEXT

public static final int T_CONTEXT
Terminal ID for CONTEXT

T_TERMINAL

public static final int T_TERMINAL
Terminal ID for TERMINAL

T_NONTERMINAL

public static final int T_NONTERMINAL
Terminal ID for NONTERMINAL

T_REDUCE

public static final int T_REDUCE
Terminal ID for REDUCE

T_INCLUDES

public static final int T_INCLUDES
Terminal ID for INCLUDES

T_WHEN

public static final int T_WHEN
Terminal ID for WHEN

T_SHIFTS

public static final int T_SHIFTS
Terminal ID for SHIFTS

T_UNSHIFTS

public static final int T_UNSHIFTS
Terminal ID for UNSHIFTS

T_ACCEPT

public static final int T_ACCEPT
Terminal ID for ACCEPT

T_PROPERTY

public static final int T_PROPERTY
Terminal ID for PROPERTY

T_MATCHES

public static final int T_MATCHES
Terminal ID for MATCHES

T_IDENT

public static final int T_IDENT
Terminal ID for IDENT

T_STRING

public static final int T_STRING
Terminal ID for STRING

T_VERSION_STRING

public static final int T_VERSION_STRING
Terminal ID for VERSION_STRING

T_COMMA

public static final int T_COMMA
Terminal ID for COMMA

T_SEMI

public static final int T_SEMI
Terminal ID for SEMI

T_EQUALS

public static final int T_EQUALS
Terminal ID for EQUALS

N_Goal

public static final int N_Goal
NonTerminal ID for Goal

N_Statement

public static final int N_Statement
NonTerminal ID for Statement

N_ThisIsStatement

public static final int N_ThisIsStatement
NonTerminal ID for ThisIsStatement

N_TerminalStatement

public static final int N_TerminalStatement
NonTerminal ID for TerminalStatement

N_MatchesStatement

public static final int N_MatchesStatement
NonTerminal ID for MatchesStatement

N_ContextStatement

public static final int N_ContextStatement
NonTerminal ID for ContextStatement

N_StartInStatement

public static final int N_StartInStatement
NonTerminal ID for StartInStatement

N_IncludesStatement

public static final int N_IncludesStatement
NonTerminal ID for IncludesStatement

N_NonterminalStatement

public static final int N_NonterminalStatement
NonTerminal ID for NonterminalStatement

N_ReduceStatement

public static final int N_ReduceStatement
NonTerminal ID for ReduceStatement

N_AcceptWhenStatement

public static final int N_AcceptWhenStatement
NonTerminal ID for AcceptWhenStatement

N_PropertyStatement

public static final int N_PropertyStatement
NonTerminal ID for PropertyStatement

N_StatementList

public static final int N_StatementList
NonTerminal ID for StatementList

N_InstructionList

public static final int N_InstructionList
NonTerminal ID for InstructionList

N_NonterminalList

public static final int N_NonterminalList
NonTerminal ID for NonterminalList

N_IdentList

public static final int N_IdentList
NonTerminal ID for IdentList

N_Instruction

public static final int N_Instruction
NonTerminal ID for Instruction

P_Goal__ThisIsStatement_StatementList

public static final int P_Goal__ThisIsStatement_StatementList
Production ID for Goal__ThisIsStatement_StatementList

P_StatementList__Statement

public static final int P_StatementList__Statement
Production ID for StatementList__Statement

P_StatementList__StatementList_Statement

public static final int P_StatementList__StatementList_Statement
Production ID for StatementList__StatementList_Statement

P_Statement__TerminalStatement

public static final int P_Statement__TerminalStatement
Production ID for Statement__TerminalStatement

P_Statement__MatchesStatement

public static final int P_Statement__MatchesStatement
Production ID for Statement__MatchesStatement

P_Statement__ContextStatement

public static final int P_Statement__ContextStatement
Production ID for Statement__ContextStatement

P_Statement__StartInStatement

public static final int P_Statement__StartInStatement
Production ID for Statement__StartInStatement

P_Statement__IncludesStatement

public static final int P_Statement__IncludesStatement
Production ID for Statement__IncludesStatement

P_Statement__NonterminalStatement

public static final int P_Statement__NonterminalStatement
Production ID for Statement__NonterminalStatement

P_Statement__ReduceStatement

public static final int P_Statement__ReduceStatement
Production ID for Statement__ReduceStatement

P_Statement__AcceptWhenStatement

public static final int P_Statement__AcceptWhenStatement
Production ID for Statement__AcceptWhenStatement

P_Statement__PropertyStatement

public static final int P_Statement__PropertyStatement
Production ID for Statement__PropertyStatement

P_ThisIsStatement__THIS_IS_IDENT_VERSION_VERSION_STRING_SEMI

public static final int P_ThisIsStatement__THIS_IS_IDENT_VERSION_VERSION_STRING_SEMI
Production ID for ThisIsStatement__THIS_IS_IDENT_VERSION_VERSION_STRING_SEMI

P_TerminalStatement__TERMINAL_IdentList_SEMI

public static final int P_TerminalStatement__TERMINAL_IdentList_SEMI
Production ID for TerminalStatement__TERMINAL_IdentList_SEMI

P_MatchesStatement__IDENT_MATCHES_STRING_SEMI

public static final int P_MatchesStatement__IDENT_MATCHES_STRING_SEMI
Production ID for MatchesStatement__IDENT_MATCHES_STRING_SEMI

P_NonterminalStatement__NONTERMINAL_IdentList_SEMI

public static final int P_NonterminalStatement__NONTERMINAL_IdentList_SEMI
Production ID for NonterminalStatement__NONTERMINAL_IdentList_SEMI

P_ContextStatement__CONTEXT_IdentList_SEMI

public static final int P_ContextStatement__CONTEXT_IdentList_SEMI
Production ID for ContextStatement__CONTEXT_IdentList_SEMI

P_StartInStatement__START_IN_CONTEXT_IDENT_SEMI

public static final int P_StartInStatement__START_IN_CONTEXT_IDENT_SEMI
Production ID for StartInStatement__START_IN_CONTEXT_IDENT_SEMI

P_IncludesStatement__IDENT_INCLUDES_InstructionList_SEMI

public static final int P_IncludesStatement__IDENT_INCLUDES_InstructionList_SEMI
Production ID for IncludesStatement__IDENT_INCLUDES_InstructionList_SEMI

P_ReduceStatement__REDUCE_IDENT_WHEN_NonterminalList_SEMI

public static final int P_ReduceStatement__REDUCE_IDENT_WHEN_NonterminalList_SEMI
Production ID for ReduceStatement__REDUCE_IDENT_WHEN_NonterminalList_SEMI

P_AcceptWhenStatement__ACCEPT_WHEN_IDENT_SEMI

public static final int P_AcceptWhenStatement__ACCEPT_WHEN_IDENT_SEMI
Production ID for AcceptWhenStatement__ACCEPT_WHEN_IDENT_SEMI

P_PropertyStatement__PROPERTY_IDENT_EQUALS_STRING_SEMI

public static final int P_PropertyStatement__PROPERTY_IDENT_EQUALS_STRING_SEMI
Production ID for PropertyStatement__PROPERTY_IDENT_EQUALS_STRING_SEMI

P_IdentList__IDENT

public static final int P_IdentList__IDENT
Production ID for IdentList__IDENT

P_IdentList__IdentList_COMMA_IDENT

public static final int P_IdentList__IdentList_COMMA_IDENT
Production ID for IdentList__IdentList_COMMA_IDENT

P_NonterminalList__IDENT

public static final int P_NonterminalList__IDENT
Production ID for NonterminalList__IDENT

P_NonterminalList__NonterminalList_IDENT

public static final int P_NonterminalList__NonterminalList_IDENT
Production ID for NonterminalList__NonterminalList_IDENT

P_InstructionList__Instruction

public static final int P_InstructionList__Instruction
Production ID for InstructionList__Instruction

P_InstructionList__InstructionList_COMMA_Instruction

public static final int P_InstructionList__InstructionList_COMMA_Instruction
Production ID for InstructionList__InstructionList_COMMA_Instruction

P_Instruction__IDENT

public static final int P_Instruction__IDENT
Production ID for Instruction__IDENT

P_Instruction__IDENT_SHIFTS_IDENT

public static final int P_Instruction__IDENT_SHIFTS_IDENT
Production ID for Instruction__IDENT_SHIFTS_IDENT

P_Instruction__IDENT_UNSHIFTS

public static final int P_Instruction__IDENT_UNSHIFTS
Production ID for Instruction__IDENT_UNSHIFTS
Constructor Detail

SyntacsGrammar

public SyntacsGrammar()
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