comparison libinterp/parse-tree/token.cc @ 16257:db7f07b22b9b

1/10 commits reworking the lexer
author John W. Eaton <jwe@octave.org>
date Mon, 11 Mar 2013 14:14:41 -0400
parents 12bf6a3f8c45
children 5c32368509a2 15f55df088e7
comparison
equal deleted inserted replaced
16255:12bf6a3f8c45 16257:db7f07b22b9b
32 #include "token.h" 32 #include "token.h"
33 #include "utils.h" 33 #include "utils.h"
34 34
35 token::token (int tv, int l, int c) 35 token::token (int tv, int l, int c)
36 { 36 {
37 maybe_cmd = false;
37 tspc = false; 38 tspc = false;
38 line_num = l; 39 line_num = l;
39 column_num = c; 40 column_num = c;
40 tok_val = tv; 41 tok_val = tv;
41 type_tag = generic_token; 42 type_tag = generic_token;
42 } 43 }
43 44
44 token::token (int tv, const std::string& s, int l, int c) 45 token::token (int tv, const std::string& s, int l, int c)
45 { 46 {
47 maybe_cmd = false;
46 tspc = false; 48 tspc = false;
47 line_num = l; 49 line_num = l;
48 column_num = c; 50 column_num = c;
49 tok_val = tv; 51 tok_val = tv;
50 type_tag = string_token; 52 type_tag = string_token;
51 str = new std::string (s); 53 str = new std::string (s);
52 } 54 }
53 55
54 token::token (int tv, double d, const std::string& s, int l, int c) 56 token::token (int tv, double d, const std::string& s, int l, int c)
55 { 57 {
58 maybe_cmd = false;
56 tspc = false; 59 tspc = false;
57 line_num = l; 60 line_num = l;
58 column_num = c; 61 column_num = c;
59 tok_val = tv; 62 tok_val = tv;
60 type_tag = double_token; 63 type_tag = double_token;
62 orig_text = s; 65 orig_text = s;
63 } 66 }
64 67
65 token::token (int tv, end_tok_type t, int l, int c) 68 token::token (int tv, end_tok_type t, int l, int c)
66 { 69 {
70 maybe_cmd = false;
67 tspc = false; 71 tspc = false;
68 line_num = l; 72 line_num = l;
69 column_num = c; 73 column_num = c;
70 tok_val = tv; 74 tok_val = tv;
71 type_tag = ettype_token; 75 type_tag = ettype_token;
72 et = t; 76 et = t;
73 } 77 }
74 78
75 token::token (int tv, symbol_table::symbol_record *s, int l, int c) 79 token::token (int tv, symbol_table::symbol_record *s, int l, int c)
76 { 80 {
81 maybe_cmd = false;
77 tspc = false; 82 tspc = false;
78 line_num = l; 83 line_num = l;
79 column_num = c; 84 column_num = c;
80 tok_val = tv; 85 tok_val = tv;
81 type_tag = sym_rec_token; 86 type_tag = sym_rec_token;
83 } 88 }
84 89
85 token::token (int tv, symbol_table::symbol_record *cls, 90 token::token (int tv, symbol_table::symbol_record *cls,
86 symbol_table::symbol_record *pkg, int l, int c) 91 symbol_table::symbol_record *pkg, int l, int c)
87 { 92 {
93 maybe_cmd = false;
88 tspc = false; 94 tspc = false;
89 line_num = l; 95 line_num = l;
90 column_num = c; 96 column_num = c;
91 tok_val = tv; 97 tok_val = tv;
92 type_tag = meta_rec_token; 98 type_tag = meta_rec_token;
96 102
97 token::token (int tv, symbol_table::symbol_record *mth, 103 token::token (int tv, symbol_table::symbol_record *mth,
98 symbol_table::symbol_record *cls, 104 symbol_table::symbol_record *cls,
99 symbol_table::symbol_record *pkg, int l, int c) 105 symbol_table::symbol_record *pkg, int l, int c)
100 { 106 {
107 maybe_cmd = false;
101 tspc = false; 108 tspc = false;
102 line_num = l; 109 line_num = l;
103 column_num = c; 110 column_num = c;
104 tok_val = tv; 111 tok_val = tv;
105 type_tag = scls_rec_token; 112 type_tag = scls_rec_token;