This class represents a model for a grammar. The content of the grammar includes the
productions, start symbol, associativities and priorities.
author: Stephan Michels version: CVS $Id: Grammar.java,v 1.16 2003/12/09 19:55:52 benedikta Exp $
If the grammar contains a production.
Parameters: production - The production, which the grammar should contain. True, if the grammar contains the production.
If the grammar contains a production with this nonterminal symbol.
Parameters: ntsymbol - Nonterminal symbol. True, if the grammar contains a production with the symbol.
Returns all production for given nonterminal symbol as a list of indices.
Parameters: ntsymbol - Nonterminal symbol List of indices from the productions
Set the location from the input source.
Parameters: location - Location in the input source.
setPriority
public void setPriority(Terminal terminal, int priority)(Code)
Set a priority of a terminal symbol.
Parameters: terminal - Terminal symbol. Parameters: priority - Priority of the symbol.
setProduction
public void setProduction(int index, Production production)(Code)
Replace a production by an index in this grammar.
Parameters: index - The index, at which the productionshould be replaced. Parameters: production - The production.