Package org.tweetyproject.preferences.io
Class UPParser
java.lang.Object
org.tweetyproject.preferences.io.UPParser
- All Implemented Interfaces:
UPParserConstants
Update Parser for reading updates for dynamic Preference Aggregation
Please note: update file syntax changed from
(index, operation, amount, element)
e.g. (1, WEAKEN, 2, a)
to
(index, operation(amount), element)
e.g. (1, -2, a)
where
-(/+) is equal to WEAKEN(/STRENGTHEN)
and 2 is the amount
-
Field Summary
Modifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface org.tweetyproject.preferences.io.UPParserConstants
DEFAULT, ELEMENT, EOF, EOL, INDEX, LBRA, OPERATION, RBRA, tokenImage
-
Constructor Summary
ConstructorDescriptionUPParser()
UPParser(InputStream stream)
Constructor with InputStream.UPParser(InputStream stream, String encoding)
Constructor with InputStream and supplied encodingConstructor.Constructor with generated Token Manager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Disable tracing.void
Enable tracing.Generate ParseException.Get the next Token.getToken(int index)
Get the specific Token.static void
void
ReInit(InputStream stream)
Reinitialise.void
ReInit(InputStream stream, String encoding)
Reinitialise.void
Reinitialise.void
Reinitialise.
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
UPParser
public UPParser() -
UPParser
Constructor with InputStream. -
UPParser
Constructor with InputStream and supplied encoding -
UPParser
Constructor. -
UPParser
Constructor with generated Token Manager.
-
-
Method Details
-
parse
public static ArrayList<Update<String>> parse(String updatefile) throws ParseException, FileNotFoundException- Throws:
ParseException
FileNotFoundException
-
main
- Throws:
ParseException
-
getUpdate
- Throws:
ParseException
FileNotFoundException
-
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.
-