| java.lang.Object net.sourceforge.chaperon.model.grammar.Grammar
Grammar | public class Grammar implements Serializable,Cloneable(Code) | | This class contains a grammar for building a parser table
author: Stephan Michels version: CVS $Id: test3.java,v 1.3 2003/01/21 22:37:19 benedikta Exp $ |
Constructor Summary | |
public | Grammar() |
Grammar | public Grammar()(Code) | | Creates a empty grammar
|
addProduction | public int addProduction(Production production)(Code) | | Add a production to this list
Parameters: production - Production, which should added Index of the production in this list |
addProduction | public void addProduction(Production[] list)(Code) | | Add a list of productions
Parameters: list - Array of productions |
contains | public boolean contains(Production production)(Code) | | If the list contains a production
Parameters: production - Production True, if the list contains the production |
contains | public boolean contains(Symbol ntsymbol)(Code) | | If the list contains a production with a special symbol
Parameters: ntsymbol - Non terminal symbol True, if the list contains a production with the symbol |
enumerateProduction | public Enumeration enumerateProduction()(Code) | | Returns a enumeration of the productions
in this list.
Enumeration of the productions |
getLocation | public String getLocation()(Code) | | Returns the location from the input source.
Location in the input source. |
getProduction | public Production[] getProduction()(Code) | | Returns the content of this list
Array of the tokens |
getProductionCount | public int getProductionCount()(Code) | | Returns the count of productions in the list
Count of productions |
getProductionList | public IntegerList getProductionList(Symbol ntsymbol)(Code) | | Returns all production for given non terminal symbol
Parameters: ntsymbol - Non terminal symbol List of indices from found productions |
getStartSymbol | public Nonterminal getStartSymbol()(Code) | | Returns the start symbol
Start symbol |
getSymbols | public SymbolSet getSymbols()(Code) | | Return all used symbols in this grammar
Set of symbols |
indexOf | public int indexOf(Production production)(Code) | | Return the index of a production
Parameters: production - Production Index of the Production |
indexOf | public int indexOf(Symbol ntsymbol)(Code) | | Return the index of the next production, which found
by a non terminal symbol
Parameters: ntsymbol - Non terminal symbol Production, which found |
removeAllProduction | public void removeAllProduction()(Code) | | Removes all productions from this list
|
removeProduction | public void removeProduction(int index)(Code) | | Removes a production by an index from this list
Parameters: index - Index of the production, which should be removed |
setLocation | public void setLocation(String location)(Code) | | Set the location from the input source.
Parameters: location - Location in the input source. |
setPriority | public void setPriority(Terminal terminal, int priority)(Code) | | |
setProduction | public void setProduction(int index, Production production) throws IndexOutOfBoundsException(Code) | | Set a production by an index
Parameters: index - The index, at which the production be inserted Parameters: production - Production |
setProduction | public void setProduction(Production[] productionArray)(Code) | | Replace the content of this list by the content of an array
Parameters: productionArray - |
setStartSymbol | public void setStartSymbol(Nonterminal startsymbol)(Code) | | Set the a symbol a start symbol
Parameters: startsymbol - |
validate | public Violations validate()(Code) | | This method validates the grammer
Return a list of violations, if thisobject isn't correct |
|
|