1 2004-09-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
3 * FunctionDeclaration.cs: check for parent being a ScriptBlock.
5 2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
7 * expression.cs: added semantic analysis for accessing fields on
8 class Binary. Semantic Analysis for Calls it takes care of
9 constructors and methods, added invocation code for built in
10 methods. Added interface IAccesible that let us resolve the '.'
11 operator. Class Args handles missing or surplus arguments. Added
12 class BuiltIn which will take care of all builtins of ECMAScript.
13 * ast.cs: added check for parent equal to ScriptBlock.
14 * SymbolTable.cs: added method Remove.
15 * Statement.cs: Added abstract class Jump of which Continue and
16 Break inherit, checks the label stuff. Added checks for Label
17 stuff to Continue and Break classes. Added method Init for
18 DoWhile. Fixes for loops statements in order to be able for have
19 nested loops. Initial support for Label statements.
20 * SemanticAnalizer.cs: added hash global_env and
21 IdentificationTable label_set for keeping track of global methods and
22 label sets. Added static constructor, method BuildGlobalEnv,
23 ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel,
24 GetLabel, RemoveLabel.
25 * Relational.cs: added code generation for ops instanceof and
26 in. Fixes for usual relational ops.
27 * Parser.cs:fixes to keep track of the inheritance chain.
28 * MathObject.cs: added internal constructor.
29 * JSFunctionAttribute.cs: added fields value and built_in_function
30 so we can decide when a method is really a built in.
31 * IdentificationTable.cs: added method Remove.
32 * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression.
34 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
36 * expression.cs: made Binary is IAssignable, added fields assign
37 and right_side, added method ResolveAssign (which now receives an
38 extra parameter, being the right side of the assigment). Take care of being
39 inside a function for array indexing. Take care of lvalue case
40 too. Assign.Emit just calls left.Emit since left knows everything
41 about the right side of the assigment after Resolve process.
42 * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
43 * BinaryOp.cs: renamed current_op to op as with the new
44 parser we no longer need to keep track of the old_op.
46 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
48 * expression.cs: do not pass the operand as a parameter to the
49 constructor as it gets after the parent gets constructed, same
50 with binary. Added code generation for array index access.
51 * Parser.cs: added ToJStoken which converts Token to JSToken,
52 factored the code for creation the Unary nodes. Take care of
54 * LateBinding.cs: back to Microsoft.JScript namespace.
57 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
59 * Parser.cs: pass the skip_count to ArrayLiteral constructor.
60 * Missing.cs: back to Microsoft.JScript namespace.
61 * ArrayLiteral.cs: added field skip_count, it tells us if this is
62 a spaced-arrayliteral, in which case we add a null value in the
63 list, added null check in the resolve and code generation process.
65 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
67 * expression.cs: added interface ICallable and and function AddArg
68 to class Call. Added class New.
69 * driver.cs: made it use the new lexer and parser.
70 * ast.cs: added field line_number, added property InFunction,
71 added class Function that factores all the code shared between
72 FunctionDeclaration and FunctionExpression.
73 * With.cs: constructor receives line number.
74 * VariableStatement.cs: constructor receives line number.
75 * VariableDeclaration.cs: Added check for parent being
76 FunctionDeclaration and FunctionExpression.
77 * Try.cs: Moved the code that used to take care of the catch to
78 Catch class. Constructor receives forming elements and line
79 number. Removed mangle_id.
80 * Throw.cs: constructor receives line number.
81 * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed
82 identifier to label in Continue and Break class, its constructor now
83 receives the label and line number. For class, constructor
84 receives its forming parts. Switch class, constructor receives
85 line number, added function AddClause and AddStm. Added class
86 Catch. Added class Labelled.
87 * SemanticAnalyser.cs: Added field anon_method_counter, properties
88 NextAnonymousMethod and CurrentAnonymousMethod.
89 * Parser.cs: function ArgumentList receives a ICallable list
90 instead of a AST. Now we add the arguments of a callable. Build
92 * Literal.cs: added constructor for 'this' literal and
93 ObjectLiteral constructor. Added RegExpLiteral class, will take
94 care of regular expressions semantic analysis and code generation.
95 * JSScanner.cs: use no more the antlr based lexer. Fix typo.
96 * JSParser.cs: make it use the new port of Rhino's Parser.
97 * FunctionObject.cs: Added constructor that receives the function name.
98 * FunctionExpression.cs: made it inherit from Function class. Added
99 constructor. Factored the code that used to set the prefix to
100 Function.set_prefix (it's shared with FunctionDeclaration). Added
101 fields local_script_func and field. Implemented Resolve and Emit
102 (now we can do: var x = function (this, method, is, anonymous) {... };).
103 * FunctionDeclaration.cs: made it inherit from Function class in
104 order to share code with FunctionExpression. Added new
105 constructor. Moved the code that used to built the prefix to
106 Function inside function set_prefix. When building the closure
107 added check for setting the type of a FunctionExpression. Moved
108 set_function_type and set_custom_attr to class Function.
109 * ForIn.cs: added constructor and fields lhs, obj and body.
110 * Block.cs: added default constructor and line number based
111 constructor. Check for elems not being null before adding.
112 * ArrayLiteral.cs: set elements in constructor.
114 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
116 * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
117 building the other block was not needed. Build the ast's for the
118 expressions and statements, keep track of the parent relationship.
120 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
122 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
123 Mozilla/Rhino's parser.
125 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
127 * jscript-lexer-parser.g: added ast building for object_literal,
128 it's disabled for now while I fix the "block Vs object_literal"
129 non-determinism problem on the parser. Added rule for
130 array_literal. Build PropertyName ast build.
131 * Literal.cs: fixed the negative numbers code generation (we must
132 optimize this). Added initial ObjectLiteral's class, code generation and
133 Resolve process. Added class ObjectLiteralItem and PropertyName.
134 * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
135 elisions we keep track of the "real" size here. Added constructor. Added initial
136 Resolve and Emit code.
137 * ASTList.cs: added Size property.
138 * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
140 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
142 * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
143 break and continue in order to jump to the desired place. Added
144 check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
145 * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
146 need to jump if the expression evaluates to true. Continue class,
147 replaced ParentIsItrStm with InLoop, emit jump to correct
148 place. Break class, implemented Resolve; deleted
149 ParentIsCorrect. DoWhile, While classes, set LoopBegin and
150 LoopEnd. While class, set LoopBegin and LoopEnd.
151 * ast.cs: Added InLoop and InSwitch.
152 * jscript-lexer-parser.g: pass parent to break_stm. Added block as
153 a statement. Temporarily disabled object_literal in order to test
154 the block structure and continue and break statements.
156 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
158 * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
159 property. Added initial pieces for Break's Resolve. Fixed bug that
160 did not let Emit the code for case clauses that came after the
161 default clause (we match the jsc behavior).
162 * jscript-lexer-parser.g: set parent of switch's clauses.
164 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
166 * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
167 * jscript-lexer-parser.g: set parent hierarchy for continue
168 statement. Set to correct parent in iteration_stm.
170 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
172 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
174 * Statement.cs: Added code generation support for 'switch' statement.
176 * jscript-lexer-parser.g: added 'using' for
177 System.Collections. Allow 'switch' statement building of its
178 ast. Added parent parameter to constructor of With. Build
181 * With.cs: code generation support for 'with' stm.
183 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
185 * Statement.cs: initial code generation of 'for'.
186 * jscript-lexer-parser.g: let's build for's ast.
188 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
190 * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
191 * expression.cs: handle Try case for field or local vars allocation.
192 * Try.cs: implemented Emit.
193 * Throw.cs: implemented code generation.
194 * FunctionDeclaration.cs: cache some values.
196 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
198 * FunctionDeclaration.cs: let's make function name formation
199 (get_name ()) a little bit less dumb. We cache the prefix now so
200 we don't have to recalculate it everytime.
202 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
204 * Literal.cs: emit the correct code for negative numbers.
205 * jscript-lexer-parser.g: set parent unary_expr.
207 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
209 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
210 * Statement.cs: Added code generation for while and do-while.
212 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
214 * Statement.cs (class if): reimplemented Emit based on fall_false.
215 * Equality.cs: added code generation for != and emit jumping code
216 only in the case we are at a global expression not statement.
217 * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
218 boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
220 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
222 * expression.cs (Binary.Emit): treat boolean operator
223 specially. Added emit_jumping_code.
224 * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
225 fall_false, which will express all boolean expressions and control
228 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
230 * Equality.cs: Moved the Emit and Resolve code here.
231 * jscript-lexer-parser.g: Build a Equality object instead of a
232 Binary object for equality_expr.
233 * expression.cs: moved equality oeprators (resolve and IL gen) to
234 Equality.Emit and Equality.Resolve.
236 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
238 * expression.cs: Added shift operators IL emit.
239 * BitwiseBinary.cs: added constructor for building it according to
240 JSToken enum. return a new object on EvaluateBitwiseBinary (this
241 needs a real implementation).
242 * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
244 * Statement.cs: added stub for While and DoWhile ast
245 representation (reworking my Emit code).
246 * jscript-parser-lexer.g: allow iteration statement ast build.
248 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
250 * expression.cs: added Modulo operator case.
252 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
254 * Convert.cs: added rule for string conversion.
256 * Plus.cs: added rule for string addition.
258 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
259 Emit (cases where there's no real operator).
261 * StringLiteral.cs: now implements Exp as can appear as a simple
262 exp in global code. Added check for Pop generation.
264 * expression.cs: added IL generation code for print func call.
265 Args class added get_element, Size and made Resolve behave as the
266 others (collect the differents Resolve's return values from each
267 of the arguments). Expression class, added default Resolve call
268 for non-Exp implementers.
270 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
271 AST, this handles the case where no postOrPrefixOp present; Unary
274 * FormalParameterList.cs: added get_element, retrieves nth element.
276 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
278 * ScriptStream.cs: let's print some messages.
280 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
282 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
284 * jscript-lexer-parser.g: keep track of return's parent.
285 * Statement.cs: added parent parameter to constructor.
287 * expression.cs: refactored Emit code from Identifier, now we take
288 care of function's paramenter references. First attack to function
289 calls, check if Resolve from Call succeed.
291 * VariableDeclaration.cs: Deleted Decl class, field_info and
292 local_builder fields were being used only by VariableDeclaration,
293 I'll keep them there.
295 * FormalParameterList.cs: added field pos to FormalParam, and set
296 it at FormalParameterList's Resolve stage.
298 * TODO: updated TODO.
300 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
302 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
304 * expression.cs: At class Conditional renamed fields. Class
305 Expression inherits from Exp as we must keep track if we must pop
306 the last value (this is for the comma operator), track the parent,
307 at Resolve we take care of the last value of the expression,
309 * VariableDeclaration.cs: updates needed because of EmitContext change.
311 * Statement.cs: added parent param to If constructor. Implement
312 Resolve and Emit for If statement.
314 * Relational.cs: Set parent. The boxing happens in the containing statement.
316 * FunctionDeclaration.cs: Added func_type field, will be used to determine the
317 type of the function we are generating (global function, method
318 from a class, etc) and attach to it the correct custom
319 attribute. Simplified the code for nested functions:
320 refactored the code so no code duplication is involved, now we
321 have only one function that retrieves the name of the function,
322 now create a new EmitContext for the body of the method.
324 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
325 current EmitContext's ILGenerator.
327 * Convert.cs: Do not throw the NotImplementedException anymore for
328 method ToBoolean, for now we always return false. This must get a
331 * CodeGenerator.cs: Deleted one of ILGenerator fields
332 from EmitContext, suffices using only one (more notes about the
333 change on the Functiondeclaration entry). Imitate jsc behavior for
334 compiled files names, aggregate the exe or dll extension after last dot.
336 * Block.cs: In order to implement the comma operator (i.e., expression,
337 assign_exp), we must track if our expressions are at a global
338 scope, in which case we must pop the last result too.
340 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
342 * Relational.cs: Initial generation of CIL for relational operators.
344 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
346 * jscript-lexer-parser.g: formal_param_list receives a parent too.
348 * SymbolTable.cs: added size and current_symbols properties.
350 * JSLocalField.cs: don't throw not ImplementedException from
351 constructor (same reason, testing purposes, must get implemented
354 * IdentificationTable.cs: added num_of_locals and current_locals properties.
356 * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
357 as fields. Not throw NotImplementedException for
358 JScriptFunctionDeclaration (testing purposes, must get implemeted
359 for real). Let's build our function closures! Added functions:
360 build_closure and build_closure_nested, build_local_fields. Keep
361 track of current parameters and locals defs.
363 * FormalParameterList.cs: made FormalParam inherit from
364 AST. Implement the Emit for parameters, yeah!
366 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
368 * Closure.cs: do not throw the exception (this allow me to run the
369 tests at mcs/jtests and check that at least i'm not generating
370 invalid CIL). Be aware that this must be really implemented.
372 * Block.cs: renamed field, and implement the double pass for
373 nested function declarations code emittion, yeah!.
375 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
377 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
378 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
379 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
380 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
381 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
383 * UnaryOp.cs: inherit from Exp now.
384 * Plus.cs: Don't throw the exception when calling constructor, let
385 it build the default handler. Return a new object when calling
386 EvaluatePlus until properly implemented.
388 * NumericUnary.cs: added new Resolve.
389 * NumericBinary.cs: assign operator val at ctr. Return a new
390 object when calling EvaluateNumericBinary until properly
391 implemented. Added Resolve.
392 * Equality.cs: added ctr and return false for EvaluateEquality
393 until properly implemented. Added Resolve's functions.
395 * Block.cs (Resolve): That check was not necessary.
397 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
398 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
399 BinaryOp and UnaryOp, and this from Exp.
400 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
401 * jscript-lexer-parser.g: deleted debugging messages. Create a
402 Assign object instance of a simple Binary obj. Same case for Equality.
404 * expression.cs: added Exp abstract class. Classes that are ast of
405 language constructions that can appear as global expressions that
406 get evaluated and then the result is discarded inherit from this
407 new class. This let meee keep track of things that must get Popped
408 or can even avoid the evaluation of it. Wrote real Resolve method
409 for classes: Unary, Binary.
410 Implemted Emit method for some binary operations (+, -, / and *),
411 for other operators some more code is still missing.
412 Identifier: handle assignment cases and global exp cases.
413 Added class Assign (compisite assignment still missing tough :-(
415 * driver.cs: deleted debug messages, added "Compilation Succeeded"
417 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
418 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
419 Exp and handle the case for global expressions that must be popped
420 after evaluation. no more invalid IL being generated! yeah!
421 * Block.cs: wrote real Resolve method, erased debug messages.
422 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
423 * BinaryOp.cs, Conditional: now inherits from Exp.
425 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
427 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
429 * CodeGenerator.cs: small fixes to generate same things that ms.
431 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
433 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
435 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
437 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
439 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
441 * jscript-lexer-parser.g: keep track of parent reference for
442 IDENTIFIER, STRING_LITERAL.
444 * expression.cs: Added 'binding' field. Added 'parent' parameter
445 to constructor. Now we emit the proper code for the identifier.
447 * VariableStatement.cs: updated to field names instead of the old
450 * VariableDeclaration.cs: Added class Decl, it constains the
451 references to the static field or LocalBuilder that are created
452 when a declaration is emitted. Deleted unuseful properties (Id,
455 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
456 object instead of a boolean.
458 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
460 * IdentificationTable.cs: Deleted Retrieve method. Contains method
461 now return an object instead of a boolean, that reference is the
462 binding associated with the identifier being searched.
464 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
466 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
468 * VariableDeclaration.cs: now I handle initialization (ex. var x =
469 2; or function f () { var x = 4; }) at global scope or at
472 * Literal.cs: Added parent param to NumericLiteral constructor.
474 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
476 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
478 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
480 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
482 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
483 "instanceof"; }' in order to be able to parse both keywords. When
484 generating the parser, one warning about nondeterminism
485 (k==1:"in") is generated ignore it.
487 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
489 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
490 not parsable now they are. Mozilla's and Janet's test suites are
491 being really helpful.
493 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
495 * jscript-lexer-parser.g: added check for non-null reference at
496 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
497 and multiple lines comments rule.
499 * jscript-lexer-parser.g: Now I keep track of the parent for most
500 of the syntatic constructs. Fixed object_literal rule.
502 * ast.cs: Added field parent. This will help me to track nested
503 blocks for all of the syntatic constructs and will allow to Emit
504 everything in one single pass.
505 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
507 * Block.cs, FunctionObject.cs: deleted parent field as AST will
508 hold it. Delete parent parameter from constructor.
509 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
510 EmitContext class. The idea is Emitting everything in one pass (decls
511 and 'Global Code' method, the parent reference let me know which IL
512 generator use, gc_ig or ig).
513 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
514 constructor. Use new parent reference for choosing the IL
515 generator. NumericLiteral a 'hard coded' int32 IL emittion added
517 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
518 the parent reference to infere which IL generator to use.
519 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
520 reference to infer which IL generator to use.
521 * expression.cs: Added paramenter parent to constructor of: Unary,
522 Binary, Conditional, Call.
524 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
526 * expression.cs: Added new field to Call class, so it can handle more arguments.
528 * StringLiteral.cs (Emit) : Load the string value.
530 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
532 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
533 custom attribute. Build default 'JScript 0' constructor. Emit
534 default initial/final code of 'Global Code'. Create default
537 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
539 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
540 repeating hand written rule all around. Change "." for DOT, dumb
541 mistake by myself. Added rule new_expr. Now we handle properly the
542 call_expr rule (as defined on the spec), and added a new
543 argument. Added subrule new_expr to left_hand_side_expr rule.
545 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
547 * expression.cs (Expression): implemented Emit.
549 * expression.cs (Binary): Emit now creates a local for the
550 different kinds of binary expressions (initial code for this).
552 * ast.cs: Emit method now is abstract instead of virtual.
554 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
556 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
557 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
558 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
559 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
560 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
561 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
562 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
563 Conditional, Call, Identifier, Args, Expression, :
566 * FunctionDeclaration.cs: Check if values are not null first (at
567 Resolve). Ignore code generation is at 'Global Code'.
569 * VariableDeclaration.cs: Now I take care of IL generation when we
570 are at statements and expressions at global code, 'Global Code'
571 method is populated with that IL.
573 * CodeGenerator.cs: Added flag for 'Global Code' method
574 emittion. Now I call 'Emit' twice. The first for declarations the
575 follower for statements and expressions at global scope.
577 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
579 * Visitor.cs: Deleted.
581 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
583 * FormalParameterList.cs: Now inherits from AST. Each of the
584 formal parameters gets into the IdentificationTable at Resolve.
586 * FunctionDeclaration.cs:Resolve (), We open a new block when
587 encountering a FunctionDeclaration, resolve de parameters and the
588 body, at the end we close the block.
590 * IdentificationTable.cs: Now we keep track of parent of the
591 current block. 'Enter (...)' now receives an object, not a
592 VarDecl. 'Contains' now take care of searching through the binding
595 * Literal.cs: Deleted 'Literal' class, was being used for
596 nothing. All the classes the inherited from it, now do it from
597 AST. A 'literal' does resolve to true by default.
599 * Relational.cs: Resolve recursively left and right.
601 * SemanticAnalyser.cs: added flag for 'print statement'.
603 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
606 * driver.cs: Init the semantic analysis phase.
608 * expression.cs: 'Unary' class, resolves its operand
609 first. 'Binary' class,resolves left and right first. 'Args' class
610 resolve all the formal parameters first. 'Expression' resolve all
611 the nested expressions first.
613 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
615 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
617 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
618 this is temporal in order to get Factorial compiled by mjs (must
619 build the types according to Ecma-262 spec).
621 * Literal.cs: Added NumericLiteral class.
623 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
625 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
626 if inside a nested block.
628 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
630 * jscript-lexer-parser.g: Now we take care of parents. This allows
631 to keep track if we are inside nested blocks. At
632 'func_decl_or_expr', now I built the FunctionDeclaration or
633 FunctionExpression first and then assign its body to it - this let
634 me get a non-null value of the FunctionExpression or
635 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
637 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
638 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
639 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
641 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
643 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
644 (gets the name of a function if it's nested). Emit code for
645 function's body. At 'Emit ()' now we take care if it's a nested
648 * FunctionObject.cs: default return type is 'void' not
649 'Object'. Function declarations without parameters map to functions with
650 'Object this' and 'VsaEngine engine' as parameters by
651 default. Assign parent to nested block.
653 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
654 a global declaration or inside a function declaration.
656 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
658 * FunctionObject.cs: Handle no parameters on functions.
660 * jscript-lexer-parser.g: Allow functions without parameters.
662 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
664 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
665 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
666 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
667 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
668 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
669 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
670 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
671 With.cs, expression.cs : Added
672 'Resolve' method stub.
674 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
676 * FormalParameterList.cs: Added FormalParam class. Change Add
677 method to receive the id and the type annotation from function's parameters.
679 * FunctionDeclaration.cs: Added code for initial function's
680 definition code generation.
682 * FunctionObject.cs: Added MethodAttributes and type_annot
683 fields. Added params_types function, which returns an array of
684 types from each of the function's parameters.
686 * IdentificationTable.cs: Added ToString method.
688 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
689 and add it again with the correct name). Not based on the Visitor
690 pattern anymore. Deleted all the VisitFOO methods. Added a
691 IdentificationTable field. Added Run, Dump methods.
693 * Statement.cs: Deleted Statement class (it was being used for
694 nothing). All classes that were having Statement as parent,
695 changed their parent to be AST.
697 * SymbolTable.cs: Added Add method that receives the id and the
698 declaration class. Retrieve changed to return an AST. Added
699 ToString method. Added 'SymbolTable parent' field.
701 * VariableDeclaration.cs: Added InitValue property.
703 * ast.cs: Added some comments and abstract method 'Resolve'.
705 * jscript-lexer-parser.g: Added parsing support for formal
706 parameters type annotations.
708 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
710 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
713 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
715 * jscript-lexer-parser.g: allow empty program files. Added type
716 annotations on var decl and function decl.
717 * VariableDeclaration.cs: added return type annotation field.
718 * FunctionExpression.cs: added return type parameter to constructor.
719 * FunctionDeclaration.cs: added return type parameter to
720 constructor. Added Emit method (just creates the static field at
721 the global object, for now).
722 * FunctionObject.cs: added return type to constructor. Changed
723 names to readable ones ;-)
725 * ScriptStream.cs: added WriteLine.
727 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
729 * ast.cs: Added 'virtual' Emit method (I might change it to be
730 abstract, but I would have to added to all classes that derive
731 from it. I'll do it later)
732 * Block.cs: Added Emit method.
733 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
734 anymore) - still missing some methods, ut on the way. A nice
735 hacking weekend coming. Added EmitContext class.
736 * ScriptBlock.cs: Added Emit method.
737 * VariableDeclaration.cs: Changed type field from string to
738 Type. Added Emit method.
739 * VariableStatement.cs: Added Emit method.
740 * driver.cs: Added CodeGeneration phase (only simple var
741 declarations support it. More coming soon).
744 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
746 * statement.cs: added Return class.
748 * Throw.cs: Added expression field, constructor and ToString.
750 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
753 * With.cs: added constructor and ToString. Back to the non-tmp
756 * jscript-parser-lexer.g: allow with_stm tree building.
758 * jscript-lexer-parser.g: changed the return type from if_stm from
759 'If' to AST. Added tree for continue_stm. Allowed building of
762 * statement.cs: switched to internal 'If' class. Added Continue
763 class. Added Break class.
765 * jscript-lexer-parser.g: build tree for function decl or expr.
767 * FunctionDeclaration.cs: added internal constructor.
769 * FunctionExpression.cs: added internal constructor.
771 * FunctionObject.cs: added internal constructor and ToString method.
773 * jscript-lexer-parser.g: added building tree for if_stm.
774 * Statement.cs: Added if class for 'if' statement.
777 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
779 * VariableDeclaration.cs: added the initializer to ToString.
781 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
784 * Block.cs, Equality.cs, Relational.cs: modified ToString
786 * Equality.cs, Relational.cs, StringLiteral.cs,
787 VariableDeclaration.cs: Added constructor
789 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
790 name convetion style to mono style.
792 * UnaryOp.cs: added operator and operand fields.
794 * VariableDeclaration.cs: chenged field name from assignExp to val.
796 * BinaryOp.cs: Made "internal" the attributes, added the two
799 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
801 * driver.cs: Dump the string representation of the parsed exps.
803 * Literal.cs: added BooleanLiteral
805 * Relational.cs: added constructor, ToString,
807 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
809 * README: added some info about hacking the grammar
811 * JSparser.cs: Updated the constructor to not receiving params.
813 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
814 JScriptParserTokenTypes.txt: update of antlr generated files from
817 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
818 can parse a little bit more useful programs like:
820 function factorial (i)
827 k = factorial (i - 1);
836 As you can see, it's not the classic factorial function
837 definition, I still have to make some tricks like storing the
838 result from the recursive call and then multiply. But this new
839 grammar it's easier to alter than the old one. Also we got support
840 for for-in statements, for statements, global expressions, support
841 for object accesors or better known as the "dot" operator. Two
842 rules are on the eye: left_hand_size_expr and call_expr, in order
843 to finish the parsing grammar and fix the bugs.
846 2003-09-29 <cesar@ciencias.unam.mx>
848 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
850 * Added VsaItem.cs, implements IVsaItem.
852 2003-09-28 <cesar@ciencias.unam.mx>
854 * VsaItems.cs: Check that no name is repeated (this was docs fault
855 :-)). This is the beauty of testing.
857 * Add VsaItems.cs, implements IVsaItems.
859 2003-09-22 <cesar@ciencias.unam.mx>
861 * DocumentContext.cs: changed constructor from internal to public,
862 this a kind of hack ;), but we can build mjs.exe with that change.
864 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
865 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
866 StringLiteral.cs, StringConstructor.cs, Statement.cs,
867 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
868 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
869 Package.cs, ObjectConstructor.cs, NumberObject.cs,
870 NumberConstructor.cs, MathObject.cs, Literal.cs,
871 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
872 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
873 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
874 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
875 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
876 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
877 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
878 ErrorConstructor.cs, EnumeratorObject.cs,
879 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
880 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
881 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
882 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
883 ActiveXObjectConstructor.cs, ActivationObject.cs:
885 indentation comformance to mono style. Returned to
886 Microsoft.JScript namespace name. Now we can build
887 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
888 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
889 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
890 about the namespace stuff, because I want people
891 to contribute NUnit tests for Microsoft.JScript public API.
893 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
895 2003-09-21 <cesar@ciencias.unam.mx>
897 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
899 2003-09-20 <cesar@ciencias.unam.mx>
901 * jscript-lexer-parser.g: We are little bit closer to the spec on
902 StringLiteral definition.
904 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
906 * jscript-lexer-parser.g: Build ast for FunctionExpression.
908 * JSObject.cs: we don't throw NotImplementedException anymore,
909 this let us use FunctionExpression to build the ast.
911 * FunctionExpression.cs: Added a FunctionObject as field, a
914 * FunctionObject.cs: Added default constructor.
916 * driver.cs: Deleted the Jsc class. We are not generating code
917 now. I'm moving to provide something like mcs's EmitContext
918 instead of the CodeGenerator class having the Reflection.Emit
919 builders and ILGenerator. This driver is just for Lexical and
920 Parsing phases testing.
922 * driver.cs: Now we are using the Microsoft.JScript public API
923 functions to load the lexer and parser.
925 * ScriptBlock.cs,Block.cs: Added ToString function.
927 2003-09-20 <cesar@ciencias.unam.mx>
929 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
930 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
931 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
932 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
933 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
934 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
935 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
936 : erased Visit method and made some mono indentation style changes.
938 * CodeGenerator.cs: commented some function calls.
939 * FunctionDeclaration.cs: moved function attributes to
940 FunctionObject class, erased Visit method.
941 * FunctionObject.cs: Here is where we store a function
942 expression/declaration info, erased Visit method.
943 * ScriptBlock.cs: Added a Block field, Block will contain the
945 * jscript-lexer-parser.g: updated the grammar to build the program
946 representation based on ScriptBlock.
948 2003-09-19 <cesar@ciencias.unam.mx>
950 * JSToken.cs: public API compliance.
952 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
954 * Context.cs: Added constructor and Document field.
955 * DocumentContext.cs: Added Name field.
956 * JSParser.cs: Integration of antlr's generated parser with
957 JSParser public API. ScriptBlock is now the principal data structure that
958 represents a Jscript .Net program.
959 * JSScanner.cs: Integration of antlr's generated lexer with
960 JSScanner public API.
962 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
963 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
965 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
967 * jscript-lexer-parser.g: Changed the namespace to
968 Microsoft.JScript.Tmp.
970 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
972 * jscript-lexer-parser.g: Got the name of a
973 global_function_declaration and also its return type if
976 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
977 * jscript-lexer-parser.g: Initial construction of AST for
978 enum_statement and package_statement.
980 * jscript-lexer-parser.g: Fixed the enum_statement to accept
981 empty enum declarations.
983 * jscript-lexer-parser.g: Got the type of a
984 veriable_declaration.
986 * jscript-lexer-parser.g: Initial construction of AST for
987 primary_expression (in particular literal).
990 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
992 * driver.cs: Modified the driver structure to be compatible
993 with our new CodeGenrator and SemanticAnalizer. I
994 removed the builders from Reflection.Emit to the
995 CodeGenerator. Added an ASTList, SemanticAnalizer and
996 CodeGenerator here. Adde methods Run, GenerateCode
999 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1000 * Statement.cs: Forgot to include it on last commit.
1002 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1004 * Decided to change temporarly namespace name
1005 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
1006 to run the code generated by our CIL code generator (on next
1007 commit will come). The problem is that we don't have the
1008 runtime support for our compiler, this involve VsaEngine class
1009 and its "friends", which I have not found a lot of
1010 doumentation for. If someone knows a docs place for them,
1011 don't hesitate to send me a email pointing to them.
1013 * Changed from public to internal Visit function at some
1016 * Package.cs: Added Name and Members fields.
1018 * SemanticAnalizer.cs: Added methods VisitPrint and
1021 * VariableDeclaration.cs: Added Type field.
1023 * Visitor.cs: Changed from public to internal. Added
1024 VisitPrint and VisitStringLiteral methods.
1026 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
1027 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
1032 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1034 * Added CmdLineError.cs and JSError.cs, last night I forgot to
1037 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1039 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
1040 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
1041 CmdLineException.cs, CmdLineOptionParser.cs,
1042 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
1043 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
1044 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
1045 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
1046 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
1047 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
1048 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
1049 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
1050 LenientDateConstructor.cs, LenientDatePrototype.cs,
1051 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
1052 LenientFunctionPrototype.cs, LenientMathObject.cs,
1053 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
1054 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
1055 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
1056 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
1057 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
1058 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
1059 PostOrPrefixOperator.cs, RangeErrorObject.cs,
1060 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
1061 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
1062 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
1063 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
1064 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
1065 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
1066 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
1067 VersionableAttribute.cs
1069 Now, I must fill in the blanks :-)
1072 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1073 * jscript-lexer-parser.g: Added conditional_compilation_directive,
1074 which is the beginning of our support for conditional compilation
1075 statements and directives in our parser. Added
1076 cc_on_statement, and some lexer rules for getting the needed
1077 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
1078 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
1081 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1083 * jscript-lexer-parser.g: Changed the format of copyright notice.
1085 This changes will allow the support
1086 for the grammar added by MS to EcmaScript (aka its JScript .Net),
1087 I'm still missing some, but they are on the way.
1089 * jscript-lexer-parser.g: Deleted function_declaration, and
1090 added global_function_declaration and type_function_declaration.
1091 I decided to make the grammar as strict as the MS docs mark,
1092 but there's a difference between what their docs says and what
1093 their compiler does. For this case I decided to follow the
1094 docs. A program like:
1095 private function F ()
1097 according to the docs, would not be syntaticly correct. But the MS
1098 compiler, accepts the grammar construct and mark the error at
1099 semantic analysis phase. I followed the docs this time.
1101 * jscript-lexer-parser.g: Added debbuger_statement.
1102 * jscript-lexer-parser.g: Added import_statement.
1103 * jscript-lexer-parser.g: Added package_statement and package_member(s).
1104 * jscript-lexer-parser.g: Added super_statement.
1105 * jscript-lexer-parser.g: Added const_statement.
1106 * jscript-lexer-parser.g: Added class_statement,
1107 interfaces_list and class_members.
1109 * jscript-lexer-parser.g: Added interface_statement and
1112 * jscript-lexer-parser.g: Added enum_statement.
1113 * jscript-lexer-parser.g: Added static_statement. The rule for
1114 this syntatic construc is: static identifier { [body] }
1115 body does not get well specified in the docs. Must search wich
1116 are the possible values of it.
1118 * jscript-lexer-parser.g: At variable_declaration, added
1119 support for explicit type declaration.
1121 * jscript-lexer-parser.g: Added numeric_literal,
1122 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1124 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1127 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1130 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1131 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1132 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
1135 That method will be the driver that will allow classes
1136 that implement the Visitor interface do a walk through the AST's
1137 elements, in particular the Semantic Analizer and the Code
1138 Generator. Every class that inherits from AST will have a Visit
1139 method, that method will receive a Visitor and a object as
1140 parameters, the only thing that it'll do is letting the Visitor
1141 call the respective method VisitX, where X is the name of the
1142 currently visited class.
1144 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
1146 * FunctionDeclaration.cs: Added constructor, Visit and ToString
1149 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
1150 program (the main entry of the parser). Also added as parameters:
1151 - An AST to source_element.
1152 - A Statement to statement.
1153 - A VariableStatement to variable_statement.
1154 - A VariableStatement to variable_declaration_list.
1155 - A FormalParamerList by formal_parameter_list.
1156 - A ASTList by function_body.
1158 And now some rules return objects:
1159 - A VariableDeclaration by variable_declaration.
1160 - A Functiondeclaration by function_declaration.
1162 * driver.cs: Added the construction of the AST of the EcmaScript
1165 * Visitor.cs: Added this file. It's the visitor interface.
1167 * VariableDeclaration.cs: Added this class, it's the AST
1168 representation of a variable declaration.
1170 * Statement.cs: Added this file. It's the logical representation
1173 * VariableStatement.cs: Added this class. It's the AST
1174 representation of a chain of variable declarations.
1176 * FormalParameterList.cs: The function declaration needs to store
1177 its parameter, we will put them on this class.
1179 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
1180 implement the semantic analysis and code generation
1181 phases. SemanticAnalizer and CodeGenerator will implement the
1182 Visitor interface, they will walk a program's
1183 AST tree and do their respective work.
1185 * IdentificationTable.cs: Added this class. The SymbolTable will be used
1186 by the SemanticAnalyzer in order to keep track of the variable
1187 declaration encountered, etc..
1189 * SymbolTable.cs: A simple hashtable but for commodity i'll call
1193 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1195 * jscript-lexer-parser.g:
1196 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
1197 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
1198 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
1199 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
1200 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
1201 - Changed INTERROGATION to CONDITIONAL.
1202 - Changed TRIANGLE to BITWISE_XOR.
1203 - Changed SLASH to DIVISION.
1204 - Changed PERCENT to REMAINDER.
1205 - Changed ADMIRATION to LOGICAL_NOT
1206 - Added BITWISE_NOT (~).
1207 - Added the INCREMENT and DECREMENT rules for
1208 left_hand_side_expression.
1209 - Increased lexer lookup from 2 to 4.
1210 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
1211 BITWISE_AND, BITWISE_OR,
1212 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
1213 REMAINDER, UNSIGNED_RIGHT_SHIFT.
1214 - Added the recursion rules for equality_expression.
1215 - Added the recursion rules for shift_expression.
1217 - The most important thing, added support for expressions like:
1220 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1223 - Erased the Context class, it was used for the first
1224 test of the print_statement and Reflection.Emit. As I erased the
1225 Program, SourceElements, SourceElement from the ANTLR grammar (for
1226 the rework of the AST tied to the MS JScript public API), I erased
1228 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1229 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1230 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1233 * jscript-lexer-parser.g:
1234 - Erased the references to the classes Program, SourceElements,
1235 SourceElement, Statement, FunctionDeclaration and erased
1236 print_statement rule.
1238 * JSCriptLexer.cs JScriptParser.cs and the other files generated
1239 by antlr, reflect changes from the grammar changes.
1241 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1242 * Added stubs for the classes:
1245 ActiveXObjectConstructor.cs
1249 AssemblyCustomAttributeList.cs
1254 BooleanConstructor.cs
1262 EnumeratorConstructor.cs
1268 FunctionConstructor.cs
1269 FunctionDeclaration.cs
1270 FunctionExpression.cs
1274 IActivationObject.cs
1280 JSFunctionAttribute.cs
1281 JSFunctionAttributeEnum.cs
1286 LenientGlobalObject.cs
1288 NumberConstructor.cs
1290 ObjectConstructor.cs
1292 RegExpConstructor.cs
1297 StringConstructor.cs
1302 VBArrayConstructor.cs
1307 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1309 * jscript-lexer-parser.g:
1310 - Added rules for: continue_statement, break_statement,
1311 return_statement, throw statement (all of them do not ensure that
1312 no LineSeparator appears between the keyword on the left and the
1313 identifier, expression or semicolon on the right, that must be fixed).
1314 - Added single line comments rule.
1316 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1318 * jscript-lexer-parser.g: Added syntatic rule for:
1320 - while and for-in subrules of iteration_statement.
1321 - Added array_literal - got tricky - I just could get the simplest rule going :)
1325 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1327 * jscript-lexer-parser.g:
1328 - Syntatic rule for iteration_statement.
1329 - "do" subrule for it.
1330 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
1331 "in") relational_expression | ) rule to relational_expression.
1332 -Added function_expression syntatic rule.
1333 - Added STRING_LITERAL to literal rules.
1334 - "Less/Greater or equal than" lexer rule.
1336 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1338 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
1340 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1342 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1345 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1347 * Added a README file. Explains the dependencies and build process.
1349 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1351 * Added this ChangeLog file.
1353 * ast.cs: Added this file. Contains the classes used for building
1354 the EcmaScript 's AST.
1356 * JScript*: These are the files generated by antlr (the parser generator).
1358 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
1360 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
1361 that will be moved to other file in the future.
1363 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.