at.jku.risc.stout.nau.data
public class InputParser extends Object
Modifier and Type | Class and Description |
---|---|
class |
InputParser.ParseException
This
ControlledException is thrown by the InputParser if
the input is malformed. |
Modifier and Type | Field and Description |
---|---|
static int |
cp_abstraction
The character used for bound atom abstraction, Default = '.'
|
static int |
cp_argsEnd
The closing parenthesis used to group the arguments of a function
application (FunctionApplication), Default = ']'
|
static int |
cp_argsSeparator
The character used to separate the arguments of a function application (
FunctionApplication), Default = cp_separator1
|
static int |
cp_argsStart
The opening parenthesis used to group the arguments of a function
application (FunctionApplication), Default = '['
|
static int |
cp_atomFrom
The begin of the variable range.
|
static int |
cp_atomTo
The end of the variable range.
|
static int |
cp_equationSign
The equation sign.
|
static int |
cp_equationSuffix1
The main equation suffix, also used to format the output.
|
static int |
cp_equationSuffix2
Another recognized equation suffix.
|
static int |
cp_equationSuffix3
Another recognized equation suffix.
|
static int |
cp_fresh
The character used for a freshness pair.
|
static int |
cp_nablaEnd
The closing parenthesis used for the set of freshness constraints,
Default = '}'
|
static int |
cp_nablaSeparator
The character used to separate the elements of the freshness context,
Default = cp_separator1
|
static int |
cp_nablaStart
The opening parenthesis used for the set of freshness constraints,
Default = '{'
|
static int |
cp_separator1
A separator character, Default = ','
|
static int |
cp_separator2
A separator character, Default = ';'
|
static int |
cp_separator3
A separator character, Default = '|'
|
static int |
cp_swapEnd
The closing parenthesis used for swapping application, Default = ')'
|
static int |
cp_swapStart
The opening parenthesis used for swapping application, Default = '('
|
static int |
cp_typeConstructor
The type constructor.
|
static int |
cp_typingSeparator
The character used to initiate the type definition.
|
static int |
cp_varFrom
The begin of the variable range.
|
static int |
cp_varTo
The end of the variable range.
|
Constructor and Description |
---|
InputParser(NodeFactory factory)
Instantiates a parser for nominal pairs and nominal terms.
|
Modifier and Type | Method and Description |
---|---|
NodeFactory |
getFactory()
Returns the factory used by this parser to instantiate the atoms of the
new term.
|
static boolean |
isArgsEnd(int codePoint)
Tests whether the given codepoint is a valid closing parenthesis to group
arguments of a function application.
|
static boolean |
isArgsStart(int codePoint)
Tests whether the given codepoint is a valid opening parenthesis to group
arguments of a function application.
|
static boolean |
isNameChar(int codePoint)
Determines if the specified character (Unicode code point) may be part of
a name.
|
static boolean |
isSwapEnd(int codePoint)
Tests whether the given codepoint is a valid opening parenthesis for
swapping application.
|
static boolean |
isSwapStart(int codePoint)
Tests whether the given codepoint is a valid opening parenthesis for
swapping application.
|
Set<Atom> |
parseAtomSet(Reader in) |
<T extends Equation<NominalTerm>> |
parseEquation(Reader in1,
Reader in2,
EquationSystem<T> eqSys) |
FreshnessCtx |
parseEquationAndCtx(Reader in1,
Reader in2,
Reader inA,
Reader inN,
EquationSystem<AntiUnifyProblem> eqSys) |
<T extends Equation<NominalTerm>> |
parseEquationSystem(Reader in,
EquationSystem<T> eqSys)
Pull characters from the given Reader and parse the input.
|
FreshnessCtx |
parseNabla(Reader in) |
NominalPair |
parsePair(Reader nablaIn,
Reader termIn) |
NominalTerm |
parseTerm(Reader in,
boolean reset)
Pull characters from the given Reader and parse the input.
|
void |
reset()
Resets the state of the parser.
|
public static int cp_abstraction
public static int cp_argsEnd
public static int cp_argsSeparator
public static int cp_argsStart
public static int cp_atomFrom
public static int cp_atomTo
public static int cp_equationSign
public static int cp_equationSuffix1
public static int cp_equationSuffix2
public static int cp_equationSuffix3
public static int cp_fresh
public static int cp_nablaEnd
public static int cp_nablaSeparator
public static int cp_nablaStart
public static int cp_separator1
public static int cp_separator2
public static int cp_separator3
public static int cp_swapEnd
public static int cp_swapStart
public static int cp_typeConstructor
public static int cp_typingSeparator
public static int cp_varFrom
public static int cp_varTo
public InputParser(NodeFactory factory)
factory
- The factory which is used to instantiate the atoms of a
nominal pair.public NodeFactory getFactory()
public static boolean isArgsEnd(int codePoint)
cp_argsEnd
||
codePoint == ')' || codePoint == ']'.public static boolean isArgsStart(int codePoint)
cp_argsStart
||
codePoint == '(' || codePoint == '['.public static boolean isNameChar(int codePoint)
A character may be part of a name if and only if one of the following statements is true:
'_'
)
'+','-','*','/','@'
isIdentifierIgnorable
returns true
for this
character.
codePoint
- the character (Unicode code point) to be tested.true
if the character may be part of a Unicode
identifier; false
otherwise.public static boolean isSwapEnd(int codePoint)
cp_swapEnd
.public static boolean isSwapStart(int codePoint)
cp_swapStart
.public Set<Atom> parseAtomSet(Reader in) throws IOException, NodeFactory.FactoryInstantiationException, MalformedSortException, InputParser.ParseException
public <T extends Equation<NominalTerm>> void parseEquation(Reader in1, Reader in2, EquationSystem<T> eqSys) throws InputParser.ParseException, NodeFactory.FactoryInstantiationException, MalformedSortException, IOException
public FreshnessCtx parseEquationAndCtx(Reader in1, Reader in2, Reader inA, Reader inN, EquationSystem<AntiUnifyProblem> eqSys) throws InputParser.ParseException, NodeFactory.FactoryInstantiationException, MalformedSortException, IOException
public <T extends Equation<NominalTerm>> void parseEquationSystem(Reader in, EquationSystem<T> eqSys) throws IOException, ControlledException
IOException
ControlledException
public FreshnessCtx parseNabla(Reader in) throws IOException, NodeFactory.FactoryInstantiationException, InputParser.ParseException, MalformedSortException
public NominalPair parsePair(Reader nablaIn, Reader termIn) throws NodeFactory.FactoryInstantiationException, InputParser.ParseException, MalformedSortException, IOException
public NominalTerm parseTerm(Reader in, boolean reset) throws InputParser.ParseException, NodeFactory.FactoryInstantiationException, MalformedSortException, IOException
public void reset()