Newick file format grammar (04-Jul-2001)

Grammar for Newick tree file format

This is a slightly simplified version of my Newick tree file format specification in BNF. The tokens I use are listed above the rules together with a short description



%token treeType     // something like "#PHYLO"
%token description  // a string 
%token edgeLength   // a double value
%token comment      // everything in brackets []

typedForest : forest                                           
        |   treeType forest                                    
;
forest      :     tree  ';'			               
        |   tree ';' forest				       
;
tree        :  	inner                                          
        | leaf                                                                                
;
nodelist    : node                                             
        |  node ',' nodelist                                   
;

node        : leaf                                             
        |  inner                                               
;

inner       :   '('  nodelist  ')' description ':' edgeLength  
	|  '('  nodelist ')'  ':' edgeLength                   
        |  '('  nodelist ')' description                      
        |  '('  nodelist ')'                                   
;

leaf        :    description ':' edgeLength                    
        |  description                                         
	| ':' edgeLength                                       

    

[BCB Software] -[TreeWiz Home] - [Screenshots] - [Applet] - [Download]


Ursula Rost
Privacy Imprint