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

Nested Class Summary
(package private) static class Newick.JJCalls
           
 
Field Summary
private static TreeNode current_node
          the current TreeNode that the parser is visiting and initiating
private static Newick.JJCalls[] jj_2_rtns
           
private static int jj_endpos
           
private static java.util.Vector jj_expentries
           
private static int[] jj_expentry
           
private static int jj_gc
           
private static int jj_gen
           
private static boolean jj_initialized_once
           
(package private) static SimpleCharStream jj_input_stream
           
private static int jj_kind
           
private static int jj_la
           
private static int[] jj_la1
           
private static int[] jj_la1_0
           
private static Token jj_lastpos
           
private static int[] jj_lasttokens
           
static Token jj_nt
           
private static int jj_ntk
           
private static boolean jj_rescan
           
private static Token jj_scanpos
           
private static boolean jj_semLA
           
static boolean lookingAhead
           
private static TreeNode tn
          a helper TreeNode field
static Token token
           
static NewickTokenManager token_source
           
private static Tree tree
          the tree to be generated from this parser
 
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()
           
protected  void finalize()
           
static ParseException generateParseException()
           
static Token getNextToken()
           
static Token getToken(int index)
           
static void Input()
           
private static boolean jj_2_1(int xla)
           
private static boolean jj_2_10(int xla)
           
private static boolean jj_2_11(int xla)
           
private static boolean jj_2_12(int xla)
           
private static boolean jj_2_2(int xla)
           
private static boolean jj_2_3(int xla)
           
private static boolean jj_2_4(int xla)
           
private static boolean jj_2_5(int xla)
           
private static boolean jj_2_6(int xla)
           
private static boolean jj_2_7(int xla)
           
private static boolean jj_2_8(int xla)
           
private static boolean jj_2_9(int xla)
           
private static boolean jj_3_1()
           
private static boolean jj_3_10()
           
private static boolean jj_3_11()
           
private static boolean jj_3_12()
           
private static boolean jj_3_2()
           
private static boolean jj_3_3()
           
private static boolean jj_3_4()
           
private static boolean jj_3_5()
           
private static boolean jj_3_6()
           
private static boolean jj_3_7()
           
private static boolean jj_3_8()
           
private static boolean jj_3_9()
           
private static boolean jj_3R_2()
           
private static boolean jj_3R_3()
           
private static boolean jj_3R_4()
           
private static boolean jj_3R_5()
           
private static boolean jj_3R_6()
           
private static boolean jj_3R_7()
           
private static boolean jj_3R_8()
           
private static void jj_add_error_token(int kind, int pos)
           
private static Token jj_consume_token(int kind)
           
private static void jj_la1_0()
           
private static int jj_ntk()
           
private static void jj_rescan_token()
           
private static void jj_save(int index, int xla)
           
private static boolean jj_scan_token(int kind)
           
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
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tree

private static Tree tree
the tree to be generated from this parser


current_node

private static TreeNode current_node
the current TreeNode that the parser is visiting and initiating


tn

private static TreeNode tn
a helper TreeNode field


jj_initialized_once

private static boolean jj_initialized_once

token_source

public static NewickTokenManager token_source

jj_input_stream

static SimpleCharStream jj_input_stream

token

public static Token token

jj_nt

public static Token jj_nt

jj_ntk

private static int jj_ntk

jj_scanpos

private static Token jj_scanpos

jj_lastpos

private static Token jj_lastpos

jj_la

private static int jj_la

lookingAhead

public static boolean lookingAhead

jj_semLA

private static boolean jj_semLA

jj_gen

private static int jj_gen

jj_la1

private static final int[] jj_la1

jj_la1_0

private static int[] jj_la1_0

jj_2_rtns

private static final Newick.JJCalls[] jj_2_rtns

jj_rescan

private static boolean jj_rescan

jj_gc

private static int jj_gc

jj_expentries

private static java.util.Vector jj_expentries

jj_expentry

private static int[] jj_expentry

jj_kind

private static int jj_kind

jj_lasttokens

private static int[] jj_lasttokens

jj_endpos

private static int jj_endpos
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()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
java.lang.Throwable

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

jj_2_1

private static final boolean jj_2_1(int xla)

jj_2_2

private static final boolean jj_2_2(int xla)

jj_2_3

private static final boolean jj_2_3(int xla)

jj_2_4

private static final boolean jj_2_4(int xla)

jj_2_5

private static final boolean jj_2_5(int xla)

jj_2_6

private static final boolean jj_2_6(int xla)

jj_2_7

private static final boolean jj_2_7(int xla)

jj_2_8

private static final boolean jj_2_8(int xla)

jj_2_9

private static final boolean jj_2_9(int xla)

jj_2_10

private static final boolean jj_2_10(int xla)

jj_2_11

private static final boolean jj_2_11(int xla)

jj_2_12

private static final boolean jj_2_12(int xla)

jj_3R_7

private static final boolean jj_3R_7()

jj_3_12

private static final boolean jj_3_12()

jj_3_3

private static final boolean jj_3_3()

jj_3_11

private static final boolean jj_3_11()

jj_3R_6

private static final boolean jj_3R_6()

jj_3R_5

private static final boolean jj_3R_5()

jj_3_10

private static final boolean jj_3_10()

jj_3_9

private static final boolean jj_3_9()

jj_3R_2

private static final boolean jj_3R_2()

jj_3_7

private static final boolean jj_3_7()

jj_3_2

private static final boolean jj_3_2()

jj_3_6

private static final boolean jj_3_6()

jj_3R_8

private static final boolean jj_3R_8()

jj_3_1

private static final boolean jj_3_1()

jj_3_5

private static final boolean jj_3_5()

jj_3_4

private static final boolean jj_3_4()

jj_3_8

private static final boolean jj_3_8()

jj_3R_4

private static final boolean jj_3R_4()

jj_3R_3

private static final boolean jj_3R_3()

jj_la1_0

private static void jj_la1_0()

ReInit

public static void ReInit(java.io.InputStream stream)

ReInit

public static void ReInit(java.io.Reader stream)

ReInit

public void ReInit(NewickTokenManager tm)

jj_consume_token

private static final Token jj_consume_token(int kind)
                                     throws ParseException
ParseException

jj_scan_token

private static final boolean jj_scan_token(int kind)

getNextToken

public static final Token getNextToken()

getToken

public static final Token getToken(int index)

jj_ntk

private static final int jj_ntk()

jj_add_error_token

private static void jj_add_error_token(int kind,
                                       int pos)

generateParseException

public static ParseException generateParseException()

enable_tracing

public static final void enable_tracing()

disable_tracing

public static final void disable_tracing()

jj_rescan_token

private static final void jj_rescan_token()

jj_save

private static final void jj_save(int index,
                                  int xla)