Class RmrsDomconInputCodec
java.lang.Object
de.saar.chorus.domgraph.codec.InputCodec
de.saar.chorus.domgraph.codec.rmrs.RmrsDomconInputCodec
- All Implemented Interfaces:
RmrsDomconInputCodecConstants
An input codec for weakly normal dominance constraints in Oz syntax. The
inputs that this codec accepts are lists of Oz terms; these terms
represent dominance and labelling atoms.
An example input looks as follows:
[label(x f(y)) dom(y z) label(z a)]
The dominance constraint represented by the Oz term is read as a weakly normal dominance constraint, i.e. we require that the right-hand sides of dominance atoms are roots, and we assume that there is an implicit inequality atom for each pair of labelled variables.
The constraints accepted by this codec are compatible with the old CHORUS demo. A line that starts with a percent sign is interpreted as a comment.
- Author:
- Alexander Koller
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface de.saar.chorus.domgraph.codec.rmrs.RmrsDomconInputCodecConstants
ARGN, ARGV, DEFAULT, EOF, EP, EQN, EQV, IDENTIFIER, NEQN, NEQV, NUMBER, PERCENT_COMMENT, QEQ, tokenImage -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with generated Token Manager.RmrsDomconInputCodec(InputStream stream) Constructor with InputStream.RmrsDomconInputCodec(InputStream stream, String encoding) Constructor with InputStream and supplied encodingRmrsDomconInputCodec(Reader stream) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAtom()voiddecode(Reader inputStream, DomGraph graph, NodeLabels labels) Reads an USR representation from aReader.final voidDisable tracing.final voidEnable tracing.Generate ParseException.final TokenGet the next Token.final TokengetToken(int index) Get the specific Token.final voidInput()voidReinitialise.voidReInit(InputStream stream) Reinitialise.voidReInit(InputStream stream, String encoding) Reinitialise.voidReinitialise.Methods 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
-
RmrsDomconInputCodec
public RmrsDomconInputCodec() -
RmrsDomconInputCodec
Constructor with InputStream. -
RmrsDomconInputCodec
Constructor with InputStream and supplied encoding -
RmrsDomconInputCodec
Constructor. -
RmrsDomconInputCodec
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
-
Input
- Throws:
ParseException
-
Atom
- 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.
-