All Packages Class Hierarchy This Package Previous Next Index
Class collage.parser.CSParser
java.lang.Object
|
+----collage.parser.CSParser
- public class CSParser
- extends Object
- implements CSParserConstants
-
error_column
-
-
error_line
-
-
error_string
-
-
expected_tokens
-
-
lookingAhead
-
-
token
-
-
token_source
-
-
CSParser(CSParserTokenManager)
-
-
CSParser(InputStream)
-
-
AddPoint(PointSequence)
-
-
disable_tracing()
-
-
enable_tracing()
-
-
getEnvi()
- Returns the environment object which contains all relevant results
of a global parsing process.
-
getNextToken()
-
-
getToken(int)
-
-
main(String[])
- The main function may be used to test this parser as an external
program.
-
NewPartTrans()
-
-
ParseAnyOf()
-
-
ParseBoolean()
- Parses a boolean constant, which may be either "true" or "false".
-
ParseCharacter()
- Parses a single character and returns it as a string.
-
ParseCollage()
- Parses a single collage.
-
ParseCollageElement(Collage)
- Parses one arbitrary element into a given collage.
-
ParseCollageGrammar()
-
Parses a complete collage grammar.
-
ParseDelete()
-
-
ParseDerivation(Table)
- Parses a derivation specification in a given Table object.
-
ParseDerivEntry(Table)
- Parses a single derivation entry into a given Table object.
-
ParseEdge(EdgeSet)
- Parses a single
Hyperedge
.
-
ParseGrammar(Grammar)
- Parses the grammar part, not including parameters or derivation
specification, into a given
Grammar
object.
-
ParseIdentifier()
- Parses an identifier and returns it as a string.
-
ParseLabel()
- Parses a label.
-
ParseNumber()
-
-
ParseOption()
- Parses an arbitrary option.
-
ParseParameter(Factory)
-
-
ParseParameters(Factory)
-
-
ParsePart(EdgeSet)
- Parses a single "part".
-
ParsePins(PointSequence)
- Parses pin-points into a given PointSequence object.
-
ParsePoint()
-
-
ParsePoints(PointSequence)
-
-
ParsePointsTerm(PointSequence)
-
-
ParsePointTerm()
-
-
ParseProduct()
-
-
ParseRule(RuleSet)
- Parses a single rule into a given RuleSet object.
-
ParseRuleProb()
-
-
ParseStartCollage()
- Parses the start collage.
-
ParseString()
- Parses a string enclosed in quotation marks.
-
ParseTerm()
-
-
PtOperation()
-
-
ReInit(CSParserTokenManager)
-
-
ReInit(InputStream)
-
-
setEnvi(Envi)
- Sets the environment object which contains all relevant results
of a global parsing process.
-
token_error()
-
token_source
public CSParserTokenManager token_source
token
public Token token
lookingAhead
public boolean lookingAhead
error_line
protected int error_line
error_column
protected int error_column
error_string
protected String error_string
expected_tokens
protected String expected_tokens[]
CSParser
public CSParser(InputStream stream)
CSParser
public CSParser(CSParserTokenManager tm)
setEnvi
public void setEnvi(Envi envi)
- Sets the environment object which contains all relevant results
of a global parsing process.
This call is neccesary before the parser can be used.
getEnvi
public Envi getEnvi()
- Returns the environment object which contains all relevant results
of a global parsing process.
Note that many parsing functions can be used locally, i.e. without
relying on, or affecting, the environment object.
main
public static void main(String args[])
- The main function may be used to test this parser as an external
program. However, the results of the parsing process are lost since
there is no way of storing the result in a file or something similar.
Therefore, this entry point is only useful for testing purposes.
ParseCollageGrammar
public final void ParseCollageGrammar() throws ParseError
- Parses a complete collage grammar.
Results are stored in the envi
member of this parser.
ParseOption
public final void ParseOption() throws ParseError
- Parses an arbitrary option.
Results are stored in the envi
member of this parser.
ParseGrammar
public final void ParseGrammar(Grammar cg) throws ParseError
- Parses the grammar part, not including parameters or derivation
specification, into a given
Grammar
object.
ParseStartCollage
public final Collage ParseStartCollage() throws ParseError
- Parses the start collage.
Returns the parsed Collage.
ParseCollage
public final Collage ParseCollage() throws ParseError
- Parses a single collage.
Returns the new collage.
ParseCollageElement
public final void ParseCollageElement(Collage collage) throws ParseError
- Parses one arbitrary element into a given collage.
Elements of a collage are pin-points, parts and edges.
ParsePins
public final void ParsePins(PointSequence pins) throws ParseError
- Parses pin-points into a given PointSequence object.
ParsePart
public final Edge ParsePart(EdgeSet edges) throws ParseError
- Parses a single "part".
If the EdgeSet
parameter is not null
then the new part will be added to the set.
- Returns:
- The parsed part
ParseParameters
public final void ParseParameters(Factory factory) throws ParseError
ParseParameter
public final void ParseParameter(Factory factory) throws ParseError
ParseEdge
public final Edge ParseEdge(EdgeSet edges) throws ParseError
- Parses a single
Hyperedge
.
If the EdgeSet
parameter is not null
then the new part will be added to the set.
Note that the Hyperedge
class, which is a subclass of
the abstract class Edge
, is the only edge class directly
known by the kernel, and thus does not require the presence of additional
implementation classes.
ParseRule
public final void ParseRule(RuleSet ruleSet) throws ParseError
- Parses a single rule into a given RuleSet object.
ParseRuleProb
public final double ParseRuleProb() throws ParseError
ParseAnyOf
public final boolean ParseAnyOf() throws ParseError
ParseDelete
public final boolean ParseDelete() throws ParseError
ParsePoints
public final void ParsePoints(PointSequence ps) throws ParseError
ParsePointsTerm
public final void ParsePointsTerm(PointSequence ps) throws ParseError
AddPoint
public final void AddPoint(PointSequence ps) throws ParseError
ParsePoint
public final Point ParsePoint() throws ParseError
ParsePointTerm
public final Point ParsePointTerm() throws ParseError
ParseDerivation
public final void ParseDerivation(Table table) throws ParseError
- Parses a derivation specification in a given Table object.
ParseDerivEntry
public final void ParseDerivEntry(Table table) throws ParseError
- Parses a single derivation entry into a given Table object.
PtOperation
public final void PtOperation() throws ParseError
NewPartTrans
public final void NewPartTrans() throws ParseError
ParseNumber
public final Number ParseNumber() throws ParseError
ParseProduct
public final Number ParseProduct() throws ParseError
ParseTerm
public final Number ParseTerm() throws ParseError
ParseLabel
public final String ParseLabel() throws ParseError
- Parses a label.
A label is considered to be a string enclosed in quotation marks,
or a single alphabetic character, or an identifier. Returns the parsed
entity as a String
.
ParseString
public final String ParseString() throws ParseError
- Parses a string enclosed in quotation marks.
The quotation marks are excluded from the resulting string.
ParseCharacter
public final String ParseCharacter() throws ParseError
- Parses a single character and returns it as a string.
ParseBoolean
public final Boolean ParseBoolean() throws ParseError
- Parses a boolean constant, which may be either "true" or "false".
ParseIdentifier
public final String ParseIdentifier() throws ParseError
- Parses an identifier and returns it as a string.
ReInit
public void ReInit(InputStream stream)
ReInit
public void ReInit(CSParserTokenManager tm)
getNextToken
public final Token getNextToken() throws ParseError
getToken
public final Token getToken(int index) throws ParseError
token_error
protected void token_error()
enable_tracing
public final void enable_tracing()
disable_tracing
public final void disable_tracing()
All Packages Class Hierarchy This Package Previous Next Index