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

Field Summary
static Token jj_nt
           
static boolean lookingAhead
           
static Token token
           
static NewickTokenManager token_source
           
 
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
 
Constructor Summary
Newick(java.io.InputStream stream)
           
Newick(NewickTokenManager tm)
           
Newick(java.io.Reader stream)
           
 
Method Summary
static double branch_length()
           
 void close()
           
static void descendant_list()
           
static void disable_tracing()
           
static void enable_tracing()
           
static ParseException generateParseException()
           
static Token getNextToken()
           
static Token getToken(int index)
           
static void Input()
           
static java.lang.String label()
           
 void parseTree(Tree t)
          function parseTree initiates field tree, call function Input to parse the input.
static java.lang.String quoted_label()
          for each quoted label, we remove double quotes from the string
static void ReInit(java.io.InputStream stream)
           
 void ReInit(NewickTokenManager tm)
           
static void ReInit(java.io.Reader stream)
           
static void subtree()
          function subtree will set name, length and weight for each tree node
static java.lang.String unquoted_label()
          for each unquoted label, we need to replace '_' by ' '
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public static NewickTokenManager token_source

token

public static Token token

jj_nt

public static Token jj_nt

lookingAhead

public static boolean lookingAhead
Constructor Detail

Newick

public Newick(java.io.InputStream stream)

Newick

public Newick(java.io.Reader stream)

Newick

public Newick(NewickTokenManager tm)
Method Detail

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()