Package net.sf.tweety.preferences.io
Class UPParser
- java.lang.Object
-
- net.sf.tweety.preferences.io.UPParser
-
- All Implemented Interfaces:
UPParserConstants
public class UPParser extends Object implements 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
Fields Modifier and Type Field Description Tokenjj_ntNext token.TokentokenCurrent token.UPParserTokenManagertoken_sourceGenerated Token Manager.-
Fields inherited from interface net.sf.tweety.preferences.io.UPParserConstants
DEFAULT, ELEMENT, EOF, EOL, INDEX, LBRA, OPERATION, RBRA, tokenImage
-
-
Constructor Summary
Constructors Constructor Description UPParser()UPParser(InputStream stream)Constructor with InputStream.UPParser(InputStream stream, String encoding)Constructor with InputStream and supplied encodingUPParser(Reader stream)Constructor.UPParser(UPParserTokenManager tm)Constructor with generated Token Manager.
-
Method Summary
Modifier and Type Method Description voiddisable_tracing()Disable tracing.voidenable_tracing()Enable tracing.ParseExceptiongenerateParseException()Generate ParseException.TokengetNextToken()Get the next Token.TokengetToken(int index)Get the specific Token.ArrayList<Update<String>>getUpdate()static voidmain(String[] args)static ArrayList<Update<String>>parse(String updatefile)voidReInit(InputStream stream)Reinitialise.voidReInit(InputStream stream, String encoding)Reinitialise.voidReInit(Reader stream)Reinitialise.voidReInit(UPParserTokenManager tm)Reinitialise.
-
-
-
Field Detail
-
token_source
public UPParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
UPParser
public UPParser()
-
UPParser
public UPParser(InputStream stream)
Constructor with InputStream.
-
UPParser
public UPParser(InputStream stream, String encoding)
Constructor with InputStream and supplied encoding
-
UPParser
public UPParser(Reader stream)
Constructor.
-
UPParser
public UPParser(UPParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
parse
public static ArrayList<Update<String>> parse(String updatefile) throws ParseException, FileNotFoundException
- Throws:
ParseExceptionFileNotFoundException
-
main
public static void main(String[] args) throws ParseException
- Throws:
ParseException
-
getUpdate
public final ArrayList<Update<String>> getUpdate() throws ParseException, FileNotFoundException
- Throws:
ParseExceptionFileNotFoundException
-
ReInit
public void ReInit(InputStream stream)
Reinitialise.
-
ReInit
public void ReInit(InputStream stream, String encoding)
Reinitialise.
-
ReInit
public void ReInit(Reader stream)
Reinitialise.
-
ReInit
public void ReInit(UPParserTokenManager tm)
Reinitialise.
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-