Mercurial > hg > octave-nkf
diff src/token.h @ 9476:d9b25c5b8ee5
handle classdef syntax in lexer and parser
author | Ryan Rusaw |
---|---|
date | Thu, 30 Jul 2009 16:26:39 -0400 |
parents | eb63fbe60fab |
children | cd96d29c5efa |
line wrap: on
line diff
--- a/src/token.h +++ b/src/token.h @@ -1,7 +1,7 @@ /* Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, - 2007, 2008 John W. Eaton + 2007, 2008, 2009 John W. Eaton This file is part of Octave. @@ -38,15 +38,21 @@ double_token, ettype_token, pttype_token, - sym_rec_token + sym_rec_token, + scls_rec_token, + meta_rec_token }; enum end_tok_type { simple_end, + classdef_end, + events_end, for_end, function_end, if_end, + methods_end, + properties_end, switch_end, while_end, try_catch_end, @@ -67,6 +73,11 @@ token (end_tok_type t, int l = -1, int c = -1); token (plot_tok_type t, int l = -1, int c = -1); token (symbol_table::symbol_record *s, int l = -1, int c = -1); + token (symbol_table::symbol_record *cls, + symbol_table::symbol_record *pkg, int l = -1, int c = -1); + token (symbol_table::symbol_record *mth, + symbol_table::symbol_record *cls, + symbol_table::symbol_record *pkg, int l = -1, int c = -1); ~token (void); @@ -79,6 +90,13 @@ plot_tok_type pttype (void); symbol_table::symbol_record *sym_rec (void); + symbol_table::symbol_record *method_rec (void); + symbol_table::symbol_record *class_rec (void); + symbol_table::symbol_record *package_rec (void); + + symbol_table::symbol_record *meta_class_rec (void); + symbol_table::symbol_record *meta_package_rec (void); + std::string text_rep (void); private: @@ -99,6 +117,17 @@ end_tok_type et; plot_tok_type pt; symbol_table::symbol_record *sr; + struct + { + symbol_table::symbol_record *mr; + symbol_table::symbol_record *cr; + symbol_table::symbol_record *pr; + } sc; + struct + { + symbol_table::symbol_record *cr; + symbol_table::symbol_record *pr; + } mc; }; std::string orig_text; };