1 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
3 * expression.cs: made Binary is IAssignable, added fields assign
4 and right_side, added method ResolveAssign (which now receives an
5 extra parameter, being the right side of the assigment). Take care of being
6 inside a function for array indexing. Take care of lvalue case
7 too. Assign.Emit just calls left.Emit since left knows everything
8 about the right side of the assigment after Resolve process.
9 * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
10 * BinaryOp.cs: renamed current_op to op as with the new
11 parser we no longer need to keep track of the old_op.
13 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
15 * expression.cs: do not pass the operand as a parameter to the
16 constructor as it gets after the parent gets constructed, same
17 with binary. Added code generation for array index access.
18 * Parser.cs: added ToJStoken which converts Token to JSToken,
19 factored the code for creation the Unary nodes. Take care of
21 * LateBinding.cs: back to Microsoft.JScript namespace.
24 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
26 * Parser.cs: pass the skip_count to ArrayLiteral constructor.
27 * Missing.cs: back to Microsoft.JScript namespace.
28 * ArrayLiteral.cs: added field skip_count, it tells us if this is
29 a spaced-arrayliteral, in which case we add a null value in the
30 list, added null check in the resolve and code generation process.
32 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
34 * expression.cs: added interface ICallable and and function AddArg
35 to class Call. Added class New.
36 * driver.cs: made it use the new lexer and parser.
37 * ast.cs: added field line_number, added property InFunction,
38 added class Function that factores all the code shared between
39 FunctionDeclaration and FunctionExpression.
40 * With.cs: constructor receives line number.
41 * VariableStatement.cs: constructor receives line number.
42 * VariableDeclaration.cs: Added check for parent being
43 FunctionDeclaration and FunctionExpression.
44 * Try.cs: Moved the code that used to take care of the catch to
45 Catch class. Constructor receives forming elements and line
46 number. Removed mangle_id.
47 * Throw.cs: constructor receives line number.
48 * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed
49 identifier to label in Continue and Break class, its constructor now
50 receives the label and line number. For class, constructor
51 receives its forming parts. Switch class, constructor receives
52 line number, added function AddClause and AddStm. Added class
53 Catch. Added class Labelled.
54 * SemanticAnalyser.cs: Added field anon_method_counter, properties
55 NextAnonymousMethod and CurrentAnonymousMethod.
56 * Parser.cs: function ArgumentList receives a ICallable list
57 instead of a AST. Now we add the arguments of a callable. Build
59 * Literal.cs: added constructor for 'this' literal and
60 ObjectLiteral constructor. Added RegExpLiteral class, will take
61 care of regular expressions semantic analysis and code generation.
62 * JSScanner.cs: use no more the antlr based lexer. Fix typo.
63 * JSParser.cs: make it use the new port of Rhino's Parser.
64 * FunctionObject.cs: Added constructor that receives the function name.
65 * FunctionExpression.cs: made it inherit from Function class. Added
66 constructor. Factored the code that used to set the prefix to
67 Function.set_prefix (it's shared with FunctionDeclaration). Added
68 fields local_script_func and field. Implemented Resolve and Emit
69 (now we can do: var x = function (this, method, is, anonymous) {... };).
70 * FunctionDeclaration.cs: made it inherit from Function class in
71 order to share code with FunctionExpression. Added new
72 constructor. Moved the code that used to built the prefix to
73 Function inside function set_prefix. When building the closure
74 added check for setting the type of a FunctionExpression. Moved
75 set_function_type and set_custom_attr to class Function.
76 * ForIn.cs: added constructor and fields lhs, obj and body.
77 * Block.cs: added default constructor and line number based
78 constructor. Check for elems not being null before adding.
79 * ArrayLiteral.cs: set elements in constructor.
81 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
83 * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
84 building the other block was not needed. Build the ast's for the
85 expressions and statements, keep track of the parent relationship.
87 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
89 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
90 Mozilla/Rhino's parser.
92 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
94 * jscript-lexer-parser.g: added ast building for object_literal,
95 it's disabled for now while I fix the "block Vs object_literal"
96 non-determinism problem on the parser. Added rule for
97 array_literal. Build PropertyName ast build.
98 * Literal.cs: fixed the negative numbers code generation (we must
99 optimize this). Added initial ObjectLiteral's class, code generation and
100 Resolve process. Added class ObjectLiteralItem and PropertyName.
101 * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
102 elisions we keep track of the "real" size here. Added constructor. Added initial
103 Resolve and Emit code.
104 * ASTList.cs: added Size property.
105 * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
107 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
109 * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
110 break and continue in order to jump to the desired place. Added
111 check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
112 * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
113 need to jump if the expression evaluates to true. Continue class,
114 replaced ParentIsItrStm with InLoop, emit jump to correct
115 place. Break class, implemented Resolve; deleted
116 ParentIsCorrect. DoWhile, While classes, set LoopBegin and
117 LoopEnd. While class, set LoopBegin and LoopEnd.
118 * ast.cs: Added InLoop and InSwitch.
119 * jscript-lexer-parser.g: pass parent to break_stm. Added block as
120 a statement. Temporarily disabled object_literal in order to test
121 the block structure and continue and break statements.
123 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
125 * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
126 property. Added initial pieces for Break's Resolve. Fixed bug that
127 did not let Emit the code for case clauses that came after the
128 default clause (we match the jsc behavior).
129 * jscript-lexer-parser.g: set parent of switch's clauses.
131 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
133 * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
134 * jscript-lexer-parser.g: set parent hierarchy for continue
135 statement. Set to correct parent in iteration_stm.
137 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
139 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
141 * Statement.cs: Added code generation support for 'switch' statement.
143 * jscript-lexer-parser.g: added 'using' for
144 System.Collections. Allow 'switch' statement building of its
145 ast. Added parent parameter to constructor of With. Build
148 * With.cs: code generation support for 'with' stm.
150 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
152 * Statement.cs: initial code generation of 'for'.
153 * jscript-lexer-parser.g: let's build for's ast.
155 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
157 * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
158 * expression.cs: handle Try case for field or local vars allocation.
159 * Try.cs: implemented Emit.
160 * Throw.cs: implemented code generation.
161 * FunctionDeclaration.cs: cache some values.
163 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
165 * FunctionDeclaration.cs: let's make function name formation
166 (get_name ()) a little bit less dumb. We cache the prefix now so
167 we don't have to recalculate it everytime.
169 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
171 * Literal.cs: emit the correct code for negative numbers.
172 * jscript-lexer-parser.g: set parent unary_expr.
174 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
176 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
177 * Statement.cs: Added code generation for while and do-while.
179 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
181 * Statement.cs (class if): reimplemented Emit based on fall_false.
182 * Equality.cs: added code generation for != and emit jumping code
183 only in the case we are at a global expression not statement.
184 * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
185 boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
187 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
189 * expression.cs (Binary.Emit): treat boolean operator
190 specially. Added emit_jumping_code.
191 * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
192 fall_false, which will express all boolean expressions and control
195 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
197 * Equality.cs: Moved the Emit and Resolve code here.
198 * jscript-lexer-parser.g: Build a Equality object instead of a
199 Binary object for equality_expr.
200 * expression.cs: moved equality oeprators (resolve and IL gen) to
201 Equality.Emit and Equality.Resolve.
203 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
205 * expression.cs: Added shift operators IL emit.
206 * BitwiseBinary.cs: added constructor for building it according to
207 JSToken enum. return a new object on EvaluateBitwiseBinary (this
208 needs a real implementation).
209 * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
211 * Statement.cs: added stub for While and DoWhile ast
212 representation (reworking my Emit code).
213 * jscript-parser-lexer.g: allow iteration statement ast build.
215 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
217 * expression.cs: added Modulo operator case.
219 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
221 * Convert.cs: added rule for string conversion.
223 * Plus.cs: added rule for string addition.
225 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
226 Emit (cases where there's no real operator).
228 * StringLiteral.cs: now implements Exp as can appear as a simple
229 exp in global code. Added check for Pop generation.
231 * expression.cs: added IL generation code for print func call.
232 Args class added get_element, Size and made Resolve behave as the
233 others (collect the differents Resolve's return values from each
234 of the arguments). Expression class, added default Resolve call
235 for non-Exp implementers.
237 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
238 AST, this handles the case where no postOrPrefixOp present; Unary
241 * FormalParameterList.cs: added get_element, retrieves nth element.
243 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
245 * ScriptStream.cs: let's print some messages.
247 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
249 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
251 * jscript-lexer-parser.g: keep track of return's parent.
252 * Statement.cs: added parent parameter to constructor.
254 * expression.cs: refactored Emit code from Identifier, now we take
255 care of function's paramenter references. First attack to function
256 calls, check if Resolve from Call succeed.
258 * VariableDeclaration.cs: Deleted Decl class, field_info and
259 local_builder fields were being used only by VariableDeclaration,
260 I'll keep them there.
262 * FormalParameterList.cs: added field pos to FormalParam, and set
263 it at FormalParameterList's Resolve stage.
265 * TODO: updated TODO.
267 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
269 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
271 * expression.cs: At class Conditional renamed fields. Class
272 Expression inherits from Exp as we must keep track if we must pop
273 the last value (this is for the comma operator), track the parent,
274 at Resolve we take care of the last value of the expression,
276 * VariableDeclaration.cs: updates needed because of EmitContext change.
278 * Statement.cs: added parent param to If constructor. Implement
279 Resolve and Emit for If statement.
281 * Relational.cs: Set parent. The boxing happens in the containing statement.
283 * FunctionDeclaration.cs: Added func_type field, will be used to determine the
284 type of the function we are generating (global function, method
285 from a class, etc) and attach to it the correct custom
286 attribute. Simplified the code for nested functions:
287 refactored the code so no code duplication is involved, now we
288 have only one function that retrieves the name of the function,
289 now create a new EmitContext for the body of the method.
291 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
292 current EmitContext's ILGenerator.
294 * Convert.cs: Do not throw the NotImplementedException anymore for
295 method ToBoolean, for now we always return false. This must get a
298 * CodeGenerator.cs: Deleted one of ILGenerator fields
299 from EmitContext, suffices using only one (more notes about the
300 change on the Functiondeclaration entry). Imitate jsc behavior for
301 compiled files names, aggregate the exe or dll extension after last dot.
303 * Block.cs: In order to implement the comma operator (i.e., expression,
304 assign_exp), we must track if our expressions are at a global
305 scope, in which case we must pop the last result too.
307 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
309 * Relational.cs: Initial generation of CIL for relational operators.
311 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
313 * jscript-lexer-parser.g: formal_param_list receives a parent too.
315 * SymbolTable.cs: added size and current_symbols properties.
317 * JSLocalField.cs: don't throw not ImplementedException from
318 constructor (same reason, testing purposes, must get implemented
321 * IdentificationTable.cs: added num_of_locals and current_locals properties.
323 * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
324 as fields. Not throw NotImplementedException for
325 JScriptFunctionDeclaration (testing purposes, must get implemeted
326 for real). Let's build our function closures! Added functions:
327 build_closure and build_closure_nested, build_local_fields. Keep
328 track of current parameters and locals defs.
330 * FormalParameterList.cs: made FormalParam inherit from
331 AST. Implement the Emit for parameters, yeah!
333 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
335 * Closure.cs: do not throw the exception (this allow me to run the
336 tests at mcs/jtests and check that at least i'm not generating
337 invalid CIL). Be aware that this must be really implemented.
339 * Block.cs: renamed field, and implement the double pass for
340 nested function declarations code emittion, yeah!.
342 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
344 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
345 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
346 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
347 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
348 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
350 * UnaryOp.cs: inherit from Exp now.
351 * Plus.cs: Don't throw the exception when calling constructor, let
352 it build the default handler. Return a new object when calling
353 EvaluatePlus until properly implemented.
355 * NumericUnary.cs: added new Resolve.
356 * NumericBinary.cs: assign operator val at ctr. Return a new
357 object when calling EvaluateNumericBinary until properly
358 implemented. Added Resolve.
359 * Equality.cs: added ctr and return false for EvaluateEquality
360 until properly implemented. Added Resolve's functions.
362 * Block.cs (Resolve): That check was not necessary.
364 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
365 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
366 BinaryOp and UnaryOp, and this from Exp.
367 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
368 * jscript-lexer-parser.g: deleted debugging messages. Create a
369 Assign object instance of a simple Binary obj. Same case for Equality.
371 * expression.cs: added Exp abstract class. Classes that are ast of
372 language constructions that can appear as global expressions that
373 get evaluated and then the result is discarded inherit from this
374 new class. This let meee keep track of things that must get Popped
375 or can even avoid the evaluation of it. Wrote real Resolve method
376 for classes: Unary, Binary.
377 Implemted Emit method for some binary operations (+, -, / and *),
378 for other operators some more code is still missing.
379 Identifier: handle assignment cases and global exp cases.
380 Added class Assign (compisite assignment still missing tough :-(
382 * driver.cs: deleted debug messages, added "Compilation Succeeded"
384 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
385 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
386 Exp and handle the case for global expressions that must be popped
387 after evaluation. no more invalid IL being generated! yeah!
388 * Block.cs: wrote real Resolve method, erased debug messages.
389 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
390 * BinaryOp.cs, Conditional: now inherits from Exp.
392 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
394 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
396 * CodeGenerator.cs: small fixes to generate same things that ms.
398 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
400 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
402 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
404 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
406 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
408 * jscript-lexer-parser.g: keep track of parent reference for
409 IDENTIFIER, STRING_LITERAL.
411 * expression.cs: Added 'binding' field. Added 'parent' parameter
412 to constructor. Now we emit the proper code for the identifier.
414 * VariableStatement.cs: updated to field names instead of the old
417 * VariableDeclaration.cs: Added class Decl, it constains the
418 references to the static field or LocalBuilder that are created
419 when a declaration is emitted. Deleted unuseful properties (Id,
422 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
423 object instead of a boolean.
425 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
427 * IdentificationTable.cs: Deleted Retrieve method. Contains method
428 now return an object instead of a boolean, that reference is the
429 binding associated with the identifier being searched.
431 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
433 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
435 * VariableDeclaration.cs: now I handle initialization (ex. var x =
436 2; or function f () { var x = 4; }) at global scope or at
439 * Literal.cs: Added parent param to NumericLiteral constructor.
441 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
443 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
445 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
447 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
449 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
450 "instanceof"; }' in order to be able to parse both keywords. When
451 generating the parser, one warning about nondeterminism
452 (k==1:"in") is generated ignore it.
454 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
456 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
457 not parsable now they are. Mozilla's and Janet's test suites are
458 being really helpful.
460 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
462 * jscript-lexer-parser.g: added check for non-null reference at
463 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
464 and multiple lines comments rule.
466 * jscript-lexer-parser.g: Now I keep track of the parent for most
467 of the syntatic constructs. Fixed object_literal rule.
469 * ast.cs: Added field parent. This will help me to track nested
470 blocks for all of the syntatic constructs and will allow to Emit
471 everything in one single pass.
472 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
474 * Block.cs, FunctionObject.cs: deleted parent field as AST will
475 hold it. Delete parent parameter from constructor.
476 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
477 EmitContext class. The idea is Emitting everything in one pass (decls
478 and 'Global Code' method, the parent reference let me know which IL
479 generator use, gc_ig or ig).
480 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
481 constructor. Use new parent reference for choosing the IL
482 generator. NumericLiteral a 'hard coded' int32 IL emittion added
484 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
485 the parent reference to infere which IL generator to use.
486 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
487 reference to infer which IL generator to use.
488 * expression.cs: Added paramenter parent to constructor of: Unary,
489 Binary, Conditional, Call.
491 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
493 * expression.cs: Added new field to Call class, so it can handle more arguments.
495 * StringLiteral.cs (Emit) : Load the string value.
497 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
499 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
500 custom attribute. Build default 'JScript 0' constructor. Emit
501 default initial/final code of 'Global Code'. Create default
504 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
506 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
507 repeating hand written rule all around. Change "." for DOT, dumb
508 mistake by myself. Added rule new_expr. Now we handle properly the
509 call_expr rule (as defined on the spec), and added a new
510 argument. Added subrule new_expr to left_hand_side_expr rule.
512 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
514 * expression.cs (Expression): implemented Emit.
516 * expression.cs (Binary): Emit now creates a local for the
517 different kinds of binary expressions (initial code for this).
519 * ast.cs: Emit method now is abstract instead of virtual.
521 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
523 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
524 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
525 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
526 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
527 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
528 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
529 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
530 Conditional, Call, Identifier, Args, Expression, :
533 * FunctionDeclaration.cs: Check if values are not null first (at
534 Resolve). Ignore code generation is at 'Global Code'.
536 * VariableDeclaration.cs: Now I take care of IL generation when we
537 are at statements and expressions at global code, 'Global Code'
538 method is populated with that IL.
540 * CodeGenerator.cs: Added flag for 'Global Code' method
541 emittion. Now I call 'Emit' twice. The first for declarations the
542 follower for statements and expressions at global scope.
544 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
546 * Visitor.cs: Deleted.
548 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
550 * FormalParameterList.cs: Now inherits from AST. Each of the
551 formal parameters gets into the IdentificationTable at Resolve.
553 * FunctionDeclaration.cs:Resolve (), We open a new block when
554 encountering a FunctionDeclaration, resolve de parameters and the
555 body, at the end we close the block.
557 * IdentificationTable.cs: Now we keep track of parent of the
558 current block. 'Enter (...)' now receives an object, not a
559 VarDecl. 'Contains' now take care of searching through the binding
562 * Literal.cs: Deleted 'Literal' class, was being used for
563 nothing. All the classes the inherited from it, now do it from
564 AST. A 'literal' does resolve to true by default.
566 * Relational.cs: Resolve recursively left and right.
568 * SemanticAnalyser.cs: added flag for 'print statement'.
570 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
573 * driver.cs: Init the semantic analysis phase.
575 * expression.cs: 'Unary' class, resolves its operand
576 first. 'Binary' class,resolves left and right first. 'Args' class
577 resolve all the formal parameters first. 'Expression' resolve all
578 the nested expressions first.
580 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
582 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
584 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
585 this is temporal in order to get Factorial compiled by mjs (must
586 build the types according to Ecma-262 spec).
588 * Literal.cs: Added NumericLiteral class.
590 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
592 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
593 if inside a nested block.
595 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
597 * jscript-lexer-parser.g: Now we take care of parents. This allows
598 to keep track if we are inside nested blocks. At
599 'func_decl_or_expr', now I built the FunctionDeclaration or
600 FunctionExpression first and then assign its body to it - this let
601 me get a non-null value of the FunctionExpression or
602 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
604 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
605 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
606 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
608 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
610 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
611 (gets the name of a function if it's nested). Emit code for
612 function's body. At 'Emit ()' now we take care if it's a nested
615 * FunctionObject.cs: default return type is 'void' not
616 'Object'. Function declarations without parameters map to functions with
617 'Object this' and 'VsaEngine engine' as parameters by
618 default. Assign parent to nested block.
620 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
621 a global declaration or inside a function declaration.
623 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
625 * FunctionObject.cs: Handle no parameters on functions.
627 * jscript-lexer-parser.g: Allow functions without parameters.
629 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
631 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
632 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
633 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
634 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
635 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
636 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
637 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
638 With.cs, expression.cs : Added
639 'Resolve' method stub.
641 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
643 * FormalParameterList.cs: Added FormalParam class. Change Add
644 method to receive the id and the type annotation from function's parameters.
646 * FunctionDeclaration.cs: Added code for initial function's
647 definition code generation.
649 * FunctionObject.cs: Added MethodAttributes and type_annot
650 fields. Added params_types function, which returns an array of
651 types from each of the function's parameters.
653 * IdentificationTable.cs: Added ToString method.
655 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
656 and add it again with the correct name). Not based on the Visitor
657 pattern anymore. Deleted all the VisitFOO methods. Added a
658 IdentificationTable field. Added Run, Dump methods.
660 * Statement.cs: Deleted Statement class (it was being used for
661 nothing). All classes that were having Statement as parent,
662 changed their parent to be AST.
664 * SymbolTable.cs: Added Add method that receives the id and the
665 declaration class. Retrieve changed to return an AST. Added
666 ToString method. Added 'SymbolTable parent' field.
668 * VariableDeclaration.cs: Added InitValue property.
670 * ast.cs: Added some comments and abstract method 'Resolve'.
672 * jscript-lexer-parser.g: Added parsing support for formal
673 parameters type annotations.
675 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
677 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
680 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
682 * jscript-lexer-parser.g: allow empty program files. Added type
683 annotations on var decl and function decl.
684 * VariableDeclaration.cs: added return type annotation field.
685 * FunctionExpression.cs: added return type parameter to constructor.
686 * FunctionDeclaration.cs: added return type parameter to
687 constructor. Added Emit method (just creates the static field at
688 the global object, for now).
689 * FunctionObject.cs: added return type to constructor. Changed
690 names to readable ones ;-)
692 * ScriptStream.cs: added WriteLine.
694 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
696 * ast.cs: Added 'virtual' Emit method (I might change it to be
697 abstract, but I would have to added to all classes that derive
698 from it. I'll do it later)
699 * Block.cs: Added Emit method.
700 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
701 anymore) - still missing some methods, ut on the way. A nice
702 hacking weekend coming. Added EmitContext class.
703 * ScriptBlock.cs: Added Emit method.
704 * VariableDeclaration.cs: Changed type field from string to
705 Type. Added Emit method.
706 * VariableStatement.cs: Added Emit method.
707 * driver.cs: Added CodeGeneration phase (only simple var
708 declarations support it. More coming soon).
711 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
713 * statement.cs: added Return class.
715 * Throw.cs: Added expression field, constructor and ToString.
717 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
720 * With.cs: added constructor and ToString. Back to the non-tmp
723 * jscript-parser-lexer.g: allow with_stm tree building.
725 * jscript-lexer-parser.g: changed the return type from if_stm from
726 'If' to AST. Added tree for continue_stm. Allowed building of
729 * statement.cs: switched to internal 'If' class. Added Continue
730 class. Added Break class.
732 * jscript-lexer-parser.g: build tree for function decl or expr.
734 * FunctionDeclaration.cs: added internal constructor.
736 * FunctionExpression.cs: added internal constructor.
738 * FunctionObject.cs: added internal constructor and ToString method.
740 * jscript-lexer-parser.g: added building tree for if_stm.
741 * Statement.cs: Added if class for 'if' statement.
744 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
746 * VariableDeclaration.cs: added the initializer to ToString.
748 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
751 * Block.cs, Equality.cs, Relational.cs: modified ToString
753 * Equality.cs, Relational.cs, StringLiteral.cs,
754 VariableDeclaration.cs: Added constructor
756 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
757 name convetion style to mono style.
759 * UnaryOp.cs: added operator and operand fields.
761 * VariableDeclaration.cs: chenged field name from assignExp to val.
763 * BinaryOp.cs: Made "internal" the attributes, added the two
766 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
768 * driver.cs: Dump the string representation of the parsed exps.
770 * Literal.cs: added BooleanLiteral
772 * Relational.cs: added constructor, ToString,
774 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
776 * README: added some info about hacking the grammar
778 * JSparser.cs: Updated the constructor to not receiving params.
780 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
781 JScriptParserTokenTypes.txt: update of antlr generated files from
784 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
785 can parse a little bit more useful programs like:
787 function factorial (i)
794 k = factorial (i - 1);
803 As you can see, it's not the classic factorial function
804 definition, I still have to make some tricks like storing the
805 result from the recursive call and then multiply. But this new
806 grammar it's easier to alter than the old one. Also we got support
807 for for-in statements, for statements, global expressions, support
808 for object accesors or better known as the "dot" operator. Two
809 rules are on the eye: left_hand_size_expr and call_expr, in order
810 to finish the parsing grammar and fix the bugs.
813 2003-09-29 <cesar@ciencias.unam.mx>
815 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
817 * Added VsaItem.cs, implements IVsaItem.
819 2003-09-28 <cesar@ciencias.unam.mx>
821 * VsaItems.cs: Check that no name is repeated (this was docs fault
822 :-)). This is the beauty of testing.
824 * Add VsaItems.cs, implements IVsaItems.
826 2003-09-22 <cesar@ciencias.unam.mx>
828 * DocumentContext.cs: changed constructor from internal to public,
829 this a kind of hack ;), but we can build mjs.exe with that change.
831 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
832 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
833 StringLiteral.cs, StringConstructor.cs, Statement.cs,
834 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
835 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
836 Package.cs, ObjectConstructor.cs, NumberObject.cs,
837 NumberConstructor.cs, MathObject.cs, Literal.cs,
838 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
839 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
840 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
841 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
842 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
843 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
844 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
845 ErrorConstructor.cs, EnumeratorObject.cs,
846 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
847 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
848 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
849 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
850 ActiveXObjectConstructor.cs, ActivationObject.cs:
852 indentation comformance to mono style. Returned to
853 Microsoft.JScript namespace name. Now we can build
854 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
855 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
856 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
857 about the namespace stuff, because I want people
858 to contribute NUnit tests for Microsoft.JScript public API.
860 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
862 2003-09-21 <cesar@ciencias.unam.mx>
864 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
866 2003-09-20 <cesar@ciencias.unam.mx>
868 * jscript-lexer-parser.g: We are little bit closer to the spec on
869 StringLiteral definition.
871 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
873 * jscript-lexer-parser.g: Build ast for FunctionExpression.
875 * JSObject.cs: we don't throw NotImplementedException anymore,
876 this let us use FunctionExpression to build the ast.
878 * FunctionExpression.cs: Added a FunctionObject as field, a
881 * FunctionObject.cs: Added default constructor.
883 * driver.cs: Deleted the Jsc class. We are not generating code
884 now. I'm moving to provide something like mcs's EmitContext
885 instead of the CodeGenerator class having the Reflection.Emit
886 builders and ILGenerator. This driver is just for Lexical and
887 Parsing phases testing.
889 * driver.cs: Now we are using the Microsoft.JScript public API
890 functions to load the lexer and parser.
892 * ScriptBlock.cs,Block.cs: Added ToString function.
894 2003-09-20 <cesar@ciencias.unam.mx>
896 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
897 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
898 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
899 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
900 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
901 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
902 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
903 : erased Visit method and made some mono indentation style changes.
905 * CodeGenerator.cs: commented some function calls.
906 * FunctionDeclaration.cs: moved function attributes to
907 FunctionObject class, erased Visit method.
908 * FunctionObject.cs: Here is where we store a function
909 expression/declaration info, erased Visit method.
910 * ScriptBlock.cs: Added a Block field, Block will contain the
912 * jscript-lexer-parser.g: updated the grammar to build the program
913 representation based on ScriptBlock.
915 2003-09-19 <cesar@ciencias.unam.mx>
917 * JSToken.cs: public API compliance.
919 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
921 * Context.cs: Added constructor and Document field.
922 * DocumentContext.cs: Added Name field.
923 * JSParser.cs: Integration of antlr's generated parser with
924 JSParser public API. ScriptBlock is now the principal data structure that
925 represents a Jscript .Net program.
926 * JSScanner.cs: Integration of antlr's generated lexer with
927 JSScanner public API.
929 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
930 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
932 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
934 * jscript-lexer-parser.g: Changed the namespace to
935 Microsoft.JScript.Tmp.
937 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
939 * jscript-lexer-parser.g: Got the name of a
940 global_function_declaration and also its return type if
943 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
944 * jscript-lexer-parser.g: Initial construction of AST for
945 enum_statement and package_statement.
947 * jscript-lexer-parser.g: Fixed the enum_statement to accept
948 empty enum declarations.
950 * jscript-lexer-parser.g: Got the type of a
951 veriable_declaration.
953 * jscript-lexer-parser.g: Initial construction of AST for
954 primary_expression (in particular literal).
957 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
959 * driver.cs: Modified the driver structure to be compatible
960 with our new CodeGenrator and SemanticAnalizer. I
961 removed the builders from Reflection.Emit to the
962 CodeGenerator. Added an ASTList, SemanticAnalizer and
963 CodeGenerator here. Adde methods Run, GenerateCode
966 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
967 * Statement.cs: Forgot to include it on last commit.
969 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
971 * Decided to change temporarly namespace name
972 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
973 to run the code generated by our CIL code generator (on next
974 commit will come). The problem is that we don't have the
975 runtime support for our compiler, this involve VsaEngine class
976 and its "friends", which I have not found a lot of
977 doumentation for. If someone knows a docs place for them,
978 don't hesitate to send me a email pointing to them.
980 * Changed from public to internal Visit function at some
983 * Package.cs: Added Name and Members fields.
985 * SemanticAnalizer.cs: Added methods VisitPrint and
988 * VariableDeclaration.cs: Added Type field.
990 * Visitor.cs: Changed from public to internal. Added
991 VisitPrint and VisitStringLiteral methods.
993 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
994 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
999 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1001 * Added CmdLineError.cs and JSError.cs, last night I forgot to
1004 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1006 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
1007 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
1008 CmdLineException.cs, CmdLineOptionParser.cs,
1009 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
1010 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
1011 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
1012 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
1013 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
1014 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
1015 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
1016 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
1017 LenientDateConstructor.cs, LenientDatePrototype.cs,
1018 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
1019 LenientFunctionPrototype.cs, LenientMathObject.cs,
1020 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
1021 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
1022 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
1023 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
1024 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
1025 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
1026 PostOrPrefixOperator.cs, RangeErrorObject.cs,
1027 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
1028 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
1029 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
1030 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
1031 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
1032 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
1033 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
1034 VersionableAttribute.cs
1036 Now, I must fill in the blanks :-)
1039 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1040 * jscript-lexer-parser.g: Added conditional_compilation_directive,
1041 which is the beginning of our support for conditional compilation
1042 statements and directives in our parser. Added
1043 cc_on_statement, and some lexer rules for getting the needed
1044 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
1045 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
1048 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1050 * jscript-lexer-parser.g: Changed the format of copyright notice.
1052 This changes will allow the support
1053 for the grammar added by MS to EcmaScript (aka its JScript .Net),
1054 I'm still missing some, but they are on the way.
1056 * jscript-lexer-parser.g: Deleted function_declaration, and
1057 added global_function_declaration and type_function_declaration.
1058 I decided to make the grammar as strict as the MS docs mark,
1059 but there's a difference between what their docs says and what
1060 their compiler does. For this case I decided to follow the
1061 docs. A program like:
1062 private function F ()
1064 according to the docs, would not be syntaticly correct. But the MS
1065 compiler, accepts the grammar construct and mark the error at
1066 semantic analysis phase. I followed the docs this time.
1068 * jscript-lexer-parser.g: Added debbuger_statement.
1069 * jscript-lexer-parser.g: Added import_statement.
1070 * jscript-lexer-parser.g: Added package_statement and package_member(s).
1071 * jscript-lexer-parser.g: Added super_statement.
1072 * jscript-lexer-parser.g: Added const_statement.
1073 * jscript-lexer-parser.g: Added class_statement,
1074 interfaces_list and class_members.
1076 * jscript-lexer-parser.g: Added interface_statement and
1079 * jscript-lexer-parser.g: Added enum_statement.
1080 * jscript-lexer-parser.g: Added static_statement. The rule for
1081 this syntatic construc is: static identifier { [body] }
1082 body does not get well specified in the docs. Must search wich
1083 are the possible values of it.
1085 * jscript-lexer-parser.g: At variable_declaration, added
1086 support for explicit type declaration.
1088 * jscript-lexer-parser.g: Added numeric_literal,
1089 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1091 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1094 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1097 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1098 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1099 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
1102 That method will be the driver that will allow classes
1103 that implement the Visitor interface do a walk through the AST's
1104 elements, in particular the Semantic Analizer and the Code
1105 Generator. Every class that inherits from AST will have a Visit
1106 method, that method will receive a Visitor and a object as
1107 parameters, the only thing that it'll do is letting the Visitor
1108 call the respective method VisitX, where X is the name of the
1109 currently visited class.
1111 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
1113 * FunctionDeclaration.cs: Added constructor, Visit and ToString
1116 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
1117 program (the main entry of the parser). Also added as parameters:
1118 - An AST to source_element.
1119 - A Statement to statement.
1120 - A VariableStatement to variable_statement.
1121 - A VariableStatement to variable_declaration_list.
1122 - A FormalParamerList by formal_parameter_list.
1123 - A ASTList by function_body.
1125 And now some rules return objects:
1126 - A VariableDeclaration by variable_declaration.
1127 - A Functiondeclaration by function_declaration.
1129 * driver.cs: Added the construction of the AST of the EcmaScript
1132 * Visitor.cs: Added this file. It's the visitor interface.
1134 * VariableDeclaration.cs: Added this class, it's the AST
1135 representation of a variable declaration.
1137 * Statement.cs: Added this file. It's the logical representation
1140 * VariableStatement.cs: Added this class. It's the AST
1141 representation of a chain of variable declarations.
1143 * FormalParameterList.cs: The function declaration needs to store
1144 its parameter, we will put them on this class.
1146 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
1147 implement the semantic analysis and code generation
1148 phases. SemanticAnalizer and CodeGenerator will implement the
1149 Visitor interface, they will walk a program's
1150 AST tree and do their respective work.
1152 * IdentificationTable.cs: Added this class. The SymbolTable will be used
1153 by the SemanticAnalyzer in order to keep track of the variable
1154 declaration encountered, etc..
1156 * SymbolTable.cs: A simple hashtable but for commodity i'll call
1160 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1162 * jscript-lexer-parser.g:
1163 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
1164 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
1165 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
1166 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
1167 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
1168 - Changed INTERROGATION to CONDITIONAL.
1169 - Changed TRIANGLE to BITWISE_XOR.
1170 - Changed SLASH to DIVISION.
1171 - Changed PERCENT to REMAINDER.
1172 - Changed ADMIRATION to LOGICAL_NOT
1173 - Added BITWISE_NOT (~).
1174 - Added the INCREMENT and DECREMENT rules for
1175 left_hand_side_expression.
1176 - Increased lexer lookup from 2 to 4.
1177 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
1178 BITWISE_AND, BITWISE_OR,
1179 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
1180 REMAINDER, UNSIGNED_RIGHT_SHIFT.
1181 - Added the recursion rules for equality_expression.
1182 - Added the recursion rules for shift_expression.
1184 - The most important thing, added support for expressions like:
1187 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1190 - Erased the Context class, it was used for the first
1191 test of the print_statement and Reflection.Emit. As I erased the
1192 Program, SourceElements, SourceElement from the ANTLR grammar (for
1193 the rework of the AST tied to the MS JScript public API), I erased
1195 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1196 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1197 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1200 * jscript-lexer-parser.g:
1201 - Erased the references to the classes Program, SourceElements,
1202 SourceElement, Statement, FunctionDeclaration and erased
1203 print_statement rule.
1205 * JSCriptLexer.cs JScriptParser.cs and the other files generated
1206 by antlr, reflect changes from the grammar changes.
1208 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1209 * Added stubs for the classes:
1212 ActiveXObjectConstructor.cs
1216 AssemblyCustomAttributeList.cs
1221 BooleanConstructor.cs
1229 EnumeratorConstructor.cs
1235 FunctionConstructor.cs
1236 FunctionDeclaration.cs
1237 FunctionExpression.cs
1241 IActivationObject.cs
1247 JSFunctionAttribute.cs
1248 JSFunctionAttributeEnum.cs
1253 LenientGlobalObject.cs
1255 NumberConstructor.cs
1257 ObjectConstructor.cs
1259 RegExpConstructor.cs
1264 StringConstructor.cs
1269 VBArrayConstructor.cs
1274 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1276 * jscript-lexer-parser.g:
1277 - Added rules for: continue_statement, break_statement,
1278 return_statement, throw statement (all of them do not ensure that
1279 no LineSeparator appears between the keyword on the left and the
1280 identifier, expression or semicolon on the right, that must be fixed).
1281 - Added single line comments rule.
1283 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1285 * jscript-lexer-parser.g: Added syntatic rule for:
1287 - while and for-in subrules of iteration_statement.
1288 - Added array_literal - got tricky - I just could get the simplest rule going :)
1292 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1294 * jscript-lexer-parser.g:
1295 - Syntatic rule for iteration_statement.
1296 - "do" subrule for it.
1297 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
1298 "in") relational_expression | ) rule to relational_expression.
1299 -Added function_expression syntatic rule.
1300 - Added STRING_LITERAL to literal rules.
1301 - "Less/Greater or equal than" lexer rule.
1303 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1305 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
1307 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1309 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1312 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1314 * Added a README file. Explains the dependencies and build process.
1316 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1318 * Added this ChangeLog file.
1320 * ast.cs: Added this file. Contains the classes used for building
1321 the EcmaScript 's AST.
1323 * JScript*: These are the files generated by antlr (the parser generator).
1325 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
1327 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
1328 that will be moved to other file in the future.
1330 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.