Changeset 108 for branches/interpreter/interpreter4/Source.pas
- Timestamp:
- Jul 26, 2017, 11:35:26 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter/interpreter4/Source.pas
r106 r108 9 9 PAssignment = ^TAssignment; 10 10 PVariable = ^TVariable; 11 PVariableRef = ^TVariableRef; 11 12 PConstant = ^TConstant; 12 13 PIfThenElse = ^TIfThenElse; … … 19 20 PFunction = ^TFunction; 20 21 PVariables = ^TVariables; 21 22 TOperator = (opNone, opAdd, opSubtract, opAnd, opOr, opNot, opEqual, opNotEqual); 22 PGetValue = ^TGetValue; 23 24 TOperator = (opNone, opAdd, opSubtract, opAnd, opOr, opNot, opEqual, opNotEqual, 25 opLess, opGreater, opLessOrEqual, opGreaterOrEqual); 23 26 24 27 TBaseType = (btNone, btBoolean, btInteger, btChar, btShortString, btArray, … … 94 97 end; 95 98 99 TVariableRef = record 100 Variable: PVariable; 101 case TBaseType of 102 btRecord: (Field: PType); 103 btArray: (Index: PGetValue); 104 end; 105 96 106 TFunctionParameter = record 97 107 Name: string; … … 135 145 ReadType: TReadType; 136 146 case TReadType of 137 rtVariable: (Variable : PVariable);147 rtVariable: (VariableRef: PVariableRef); 138 148 rtConstant: (Constant: PConstant); 139 149 rtExpression: (Expression: PExpression); … … 141 151 rtValue: (Value: TConstant); 142 152 end; 143 PGetValue = ^TGetValue;144 153 145 154 TExpNodeType = (ntNone, ntValue, ntOperator); … … 155 164 156 165 TAssignment = record 157 Destination: PVariable ;166 Destination: PVariableRef; 158 167 Source: TGetValue; 159 168 end; … … 249 258 var 250 259 OperatorString: array[TOperator] of string = ('', '+', '-', 'and', 'or', 'not', 251 '=', '<>' );260 '=', '<>', '<', '>', '<=', '>='); 252 261 253 262 const 254 OperatorPrecedence: array[0.. 6] of TOperator = (opNot, opAnd, opOr, opAdd,255 opSubtract, opEqual, opNotEqual );263 OperatorPrecedence: array[0..10] of TOperator = (opNot, opAnd, opOr, opAdd, 264 opSubtract, opEqual, opNotEqual, opLess, opGreater, opLessOrEqual, opGreaterOrEqual); 256 265 Keywords: array[0..18] of string = ('begin', 'end', 'if', 'then', 'else', 'while', 257 266 'do', 'type', 'var', 'const', 'uses', 'unit', 'program', 'array', 'procedure',
Note:
See TracChangeset
for help on using the changeset viewer.