Package java_cup.runtime
Class DefaultSymbolFactory
- java.lang.Object
-
- java_cup.runtime.DefaultSymbolFactory
-
- All Implemented Interfaces:
SymbolFactory
public class DefaultSymbolFactory extends java.lang.Object implements SymbolFactory
Default Implementation for SymbolFactory, creates plain old Symbols- Version:
- last updated 27-03-2006
- Author:
- Michael Petter
-
-
Constructor Summary
Constructors Constructor Description DefaultSymbolFactory()
Deprecated.as of CUP v11a replaced by the new java_cup.runtime.ComplexSymbolFactory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Symbol
newSymbol(java.lang.String name, int id)
newSymbol creates a basic symbol; used frequently for terminal symbols, like keywordsSymbol
newSymbol(java.lang.String name, int id, int left, int right)
Symbol
newSymbol(java.lang.String name, int id, int left, int right, java.lang.Object value)
Symbol
newSymbol(java.lang.String name, int id, Symbol left, Symbol right)
newSymbol creates a symbol, grouping other symbols with left/right locations; used frequently by the parser to implement non-terminal symbolsSymbol
newSymbol(java.lang.String name, int id, Symbol left, Symbol right, java.lang.Object value)
newSymbol creates a symbol with a value, grouping other symbols with left/right locations; used frequently by the parser to implement non-terminal symbolsSymbol
newSymbol(java.lang.String name, int id, Symbol left, java.lang.Object value)
newSymbol creates a symbol for an empty production, taking its location from the Symbol on the leftSymbol
newSymbol(java.lang.String name, int id, java.lang.Object value)
newSymbol creates a basic symbol with an attached value; used frequently for terminal symbols like identifiersSymbol
startSymbol(java.lang.String name, int id, int state)
newSymbol creates the start symbol
-
-
-
Constructor Detail
-
DefaultSymbolFactory
public DefaultSymbolFactory()
Deprecated.as of CUP v11a replaced by the new java_cup.runtime.ComplexSymbolFactoryDefaultSymbolFactory for CUP. Users are strongly encoraged to use ComplexSymbolFactory instead, since it offers more detailed information about Symbols in source code. Yet since migrating has always been a critical process, You have the chance of still using the oldstyle Symbols.
-
-
Method Detail
-
newSymbol
public Symbol newSymbol(java.lang.String name, int id, Symbol left, Symbol right, java.lang.Object value)
Description copied from interface:SymbolFactory
newSymbol creates a symbol with a value, grouping other symbols with left/right locations; used frequently by the parser to implement non-terminal symbols- Specified by:
newSymbol
in interfaceSymbolFactory
- Parameters:
name
- Textual name for the Symbol for verbose error messagesid
- enum value associated with this symbol, generated by cup via sym.javaleft
- symbol, to take the left location fromright
- symbol, to take the right location fromvalue
- value, attached to this symbol
-
newSymbol
public Symbol newSymbol(java.lang.String name, int id, Symbol left, java.lang.Object value)
Description copied from interface:SymbolFactory
newSymbol creates a symbol for an empty production, taking its location from the Symbol on the left- Specified by:
newSymbol
in interfaceSymbolFactory
- Parameters:
name
- Textual name for the Symbol for verbose error messagesid
- enum value associated with this symbol, generated by cup via sym.javaleft
- symbol, to take the left location fromvalue
- value, attached to this symbol
-
newSymbol
public Symbol newSymbol(java.lang.String name, int id, Symbol left, Symbol right)
Description copied from interface:SymbolFactory
newSymbol creates a symbol, grouping other symbols with left/right locations; used frequently by the parser to implement non-terminal symbols- Specified by:
newSymbol
in interfaceSymbolFactory
- Parameters:
name
- Textual name for the Symbol for verbose error messagesid
- enum value associated with this symbol, generated by cup via sym.javaleft
- symbol, to take the left location fromright
- symbol, to take the right location from
-
newSymbol
public Symbol newSymbol(java.lang.String name, int id, int left, int right, java.lang.Object value)
-
newSymbol
public Symbol newSymbol(java.lang.String name, int id, int left, int right)
-
startSymbol
public Symbol startSymbol(java.lang.String name, int id, int state)
Description copied from interface:SymbolFactory
newSymbol creates the start symbol- Specified by:
startSymbol
in interfaceSymbolFactory
- Parameters:
name
- Textual name for the Symbol for verbose error messagesid
- enum value associated with this symbol, generated by cup via sym.java
-
newSymbol
public Symbol newSymbol(java.lang.String name, int id)
Description copied from interface:SymbolFactory
newSymbol creates a basic symbol; used frequently for terminal symbols, like keywords- Specified by:
newSymbol
in interfaceSymbolFactory
- Parameters:
name
- Textual name for the Symbol for verbose error messagesid
- enum value associated with this symbol, generated by cup via sym.java
-
newSymbol
public Symbol newSymbol(java.lang.String name, int id, java.lang.Object value)
Description copied from interface:SymbolFactory
newSymbol creates a basic symbol with an attached value; used frequently for terminal symbols like identifiers- Specified by:
newSymbol
in interfaceSymbolFactory
- Parameters:
name
- Textual name for the Symbol for verbose error messagesid
- enum value associated with this symbol, generated by cup via sym.javavalue
- value, attached to this symbol
-
-