nl_tokens: reading a top statement ebnf top_statement :: = namespace | function | class | interface | trait | use_statements | const_list | statement
pl_tokens: function ( ) { switch ( this . token ) { case this . tok . T_FUNCTION : return this . read_function ( false , false ) ; // optional flags case this . tok . T_ABSTRACT : <mask> this . tok . T_FINAL : case this . tok . T_CLASS : return this . read_class ( ) ; case this . tok . T_INTERFACE : return this . read_interface ( ) ; case this . tok . T_TRAIT : return this . read_trait ( ) ; case this . tok . T_USE : return this . read_use_statement ( ) ; case this . tok . T_CONST : { const result = this . node ( "constantstatement" ) ; const items = this . next ( ) . read_const_list ( ) ; this . expectEndOfStatement ( ) ; return result ( null , items ) ; } case this . tok . T_NAMESPACE : return this . read_namespace ( ) ; case this . tok . T_HALT_COMPILER : { const result = this . node ( "halt" ) ; if ( this . next ( ) . expect ( "(" ) ) this . next ( ) ; if ( this . expect ( ")" ) ) this . next ( ) ; this . expect ( ";" ) ; this . lexer . done = true ; return result ( this . lexer . _input . substring ( this . lexer . offset ) ) ; } default : return this . read_statement ( ) ; } }