Package nl.rrd.wool.parser
Class WoolParser
- java.lang.Object
-
- nl.rrd.wool.parser.WoolParser
-
public class WoolParser extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringNODE_NAME_REGEX
-
Constructor Summary
Constructors Constructor Description WoolParser(File file)WoolParser(String filename)WoolParser(String dialogueName, InputStream input)WoolParser(String dialogueName, Reader reader)
-
Method Summary
Modifier and Type Method Description voidclose()static voidmain(String[] args)ReadResultreadDialogue()Tries to read the dialogue file.static intskipWhitespace(String s, int start)Reads whitespace characters from the specified index and returns the number of characters read.
-
-
-
Field Detail
-
NODE_NAME_REGEX
public static final String NODE_NAME_REGEX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WoolParser
public WoolParser(String filename) throws FileNotFoundException
- Throws:
FileNotFoundException
-
WoolParser
public WoolParser(File file) throws FileNotFoundException
- Throws:
FileNotFoundException
-
WoolParser
public WoolParser(String dialogueName, InputStream input)
-
-
Method Detail
-
close
public void close() throws IOException- Throws:
IOException
-
readDialogue
public ReadResult readDialogue() throws IOException
Tries to read the dialogue file. If a reading error occurs, it throws anIOException. Otherwise it returns a result object where either the dialogue is set, or one or more parse errors are set.- Returns:
- the read result
- Throws:
IOException- if a reading error occurs
-
skipWhitespace
public static int skipWhitespace(String s, int start)
Reads whitespace characters from the specified index and returns the number of characters read.- Parameters:
s- the stringstart- the start index- Returns:
- the number of whitespace characters
-
main
public static void main(String[] args)
-
-