Parser
Class Newick
java.lang.Object
|
+--Parser.Newick
- All Implemented Interfaces:
- NewickConstants
- public class Newick
- extends java.lang.Object
- implements NewickConstants
A static class used for parsing a Newick format file containing just one tree
- Author:
- Yunhong Zhou, Tamara Munzner
Fields inherited from interface Parser.NewickConstants |
alpha, both_char, comment, DEFAULT, digit, double_number, EOF, exponent, number, only_quote_char, quoted_char, quoted_string, single_quote, tokenImage, unquoted_char, unquoted_string, whitespace |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
token_source
public static NewickTokenManager token_source
token
public static Token token
jj_nt
public static Token jj_nt
lookingAhead
public static boolean lookingAhead
Newick
public Newick(java.io.InputStream stream)
Newick
public Newick(java.io.Reader stream)
Newick
public Newick(NewickTokenManager tm)
parseTree
public void parseTree(Tree t)
- function parseTree initiates field tree, call function Input to parse the input.
- Parameters:
t
- Tree t will be initiated throught the parsing process
close
public void close()
Input
public static final void Input()
throws ParseException
ParseException
descendant_list
public static final void descendant_list()
throws ParseException
ParseException
subtree
public static final void subtree()
throws ParseException
- function subtree will set name, length and weight for each tree node
ParseException
label
public static final java.lang.String label()
throws ParseException
ParseException
unquoted_label
public static final java.lang.String unquoted_label()
throws ParseException
- for each unquoted label, we need to replace '_' by ' '
ParseException
quoted_label
public static final java.lang.String quoted_label()
throws ParseException
- for each quoted label, we remove double quotes from the string
ParseException
branch_length
public static final double branch_length()
throws ParseException
ParseException
ReInit
public static void ReInit(java.io.InputStream stream)
ReInit
public static void ReInit(java.io.Reader stream)
ReInit
public void ReInit(NewickTokenManager tm)
getNextToken
public static final Token getNextToken()
getToken
public static final Token getToken(int index)
generateParseException
public static ParseException generateParseException()
enable_tracing
public static final void enable_tracing()
disable_tracing
public static final void disable_tracing()