question: returns a new token object , by default . however , if you want , you can create and return subclass objects based on the value of ofkind . simply add the cases to the switch for all those special cases . for example , if you have a subclass of token called idtoken that you want to create if ofkind is id , simlpy add something like : case myparserconstants.id : return new idtoken ; to the following switch statement . then you can cast matchedtoken variable to the appropriate type and use it in your lexical actions . concode_field_sep int endLine concode_elem_sep Token next concode_elem_sep String image concode_elem_sep int endColumn concode_elem_sep Token specialToken concode_elem_sep int beginColumn concode_elem_sep int kind concode_elem_sep int beginLine concode_field_sep String toString
target: Token function ( int arg0 ) { switch ( arg0 ) { default : return new Token ( ) ; } }