Class GlueInputCodec
- All Implemented Interfaces:
GlueInputCodecConstants
The concrete syntax of the input is ad-hoc and doesn't reflect
the format of the formulas computed by the XLE. Glue formulas
can be built up from variables (starting with uppercase letters),
atoms (starting with lowercase letters), and the implication
symbol -o. If the antecedent of an implication is not atomic
(i.e. not an atom or a variable), then it must be surrounded by
brackets. The consequent of an implication may never be
in brackets. We will presumably switch to a different concrete
syntax at some point, so there's no point in making the parser
perfect right now.
An example input looks as follows:
[(((X -o z) -o w) -o a) -o Y, (X -o a) -o b -o c, Y]
- Author:
- Etienne Ailloud, Alexander Koller
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface de.saar.chorus.domgraph.codec.glue.GlueInputCodecConstants
ATOM, DEFAULT, EOF, IMP, PERCENT_COMMENT, tokenImage, VAR -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with generated Token Manager.GlueInputCodec(InputStream stream) Constructor with InputStream.GlueInputCodec(InputStream stream, String encoding) Constructor with InputStream and supplied encodingGlueInputCodec(Reader stream) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(Reader inputStream, DomGraph graph, NodeLabels labels) Reads an USR representation from aReader.final voidDisable tracing.final voidEnable tracing.final de.saar.chorus.domgraph.codec.glue.Formulaformula()Generate ParseException.final TokenGet the next Token.final TokengetToken(int index) Get the specific Token.final voidlist()voidReinitialise.voidReInit(InputStream stream) Reinitialise.voidReInit(InputStream stream, String encoding) Reinitialise.voidReinitialise.final de.saar.chorus.domgraph.codec.glue.FormulaMethods inherited from class de.saar.chorus.domgraph.codec.InputCodec
getReaderForSpecification
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
GlueInputCodec
public GlueInputCodec() -
GlueInputCodec
Constructor with InputStream. -
GlueInputCodec
Constructor with InputStream and supplied encoding -
GlueInputCodec
Constructor. -
GlueInputCodec
Constructor with generated Token Manager.
-
-
Method Details
-
decode
public void decode(Reader inputStream, DomGraph graph, NodeLabels labels) throws IOException, ParserException, MalformedDomgraphException Description copied from class:InputCodecReads an USR representation from aReader. This method converts the USR into an equivalent labelled dominance graph and stores this graph in aDomGraphand the labels in aNodeLabelsobject. You must implement this method in every concrete input codec.The graph and labels objects passed to this method need not be empty; it is the responsibility of this method to clear them first.
- Specified by:
decodein classInputCodec- Parameters:
inputStream- the reader from which the USR is readgraph- the dominance graph into which the USR is convertedlabels- the node labels of the labelled dominance graph- Throws:
IOException- if an I/O error occurred while reading fromreaderParserException- if a syntactic error occurred while parsing the USRMalformedDomgraphException- if a semantic error occurred, i.e. the USR cannot be converted into a dominance graph
-
list
- Throws:
ParseException
-
formula
- Throws:
ParseException
-
VarOrAtom
- Throws:
ParseException
-
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
generateParseException
Generate ParseException. -
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-