1 2004-09-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
3 * Parser.cs: use ToJSToken to set the operator properly.
4 * FunctionDeclaration.cs: delete spaces.
6 2004-09-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
8 * FunctionDeclaration.cs: check for parent being a ScriptBlock.
10 2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
12 * expression.cs: added semantic analysis for accessing fields on
13 class Binary. Semantic Analysis for Calls it takes care of
14 constructors and methods, added invocation code for built in
15 methods. Added interface IAccesible that let us resolve the '.'
16 operator. Class Args handles missing or surplus arguments. Added
17 class BuiltIn which will take care of all builtins of ECMAScript.
18 * ast.cs: added check for parent equal to ScriptBlock.
19 * SymbolTable.cs: added method Remove.
20 * Statement.cs: Added abstract class Jump of which Continue and
21 Break inherit, checks the label stuff. Added checks for Label
22 stuff to Continue and Break classes. Added method Init for
23 DoWhile. Fixes for loops statements in order to be able for have
24 nested loops. Initial support for Label statements.
25 * SemanticAnalizer.cs: added hash global_env and
26 IdentificationTable label_set for keeping track of global methods and
27 label sets. Added static constructor, method BuildGlobalEnv,
28 ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel,
29 GetLabel, RemoveLabel.
30 * Relational.cs: added code generation for ops instanceof and
31 in. Fixes for usual relational ops.
32 * Parser.cs:fixes to keep track of the inheritance chain.
33 * MathObject.cs: added internal constructor.
34 * JSFunctionAttribute.cs: added fields value and built_in_function
35 so we can decide when a method is really a built in.
36 * IdentificationTable.cs: added method Remove.
37 * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression.
39 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
41 * expression.cs: made Binary is IAssignable, added fields assign
42 and right_side, added method ResolveAssign (which now receives an
43 extra parameter, being the right side of the assigment). Take care of being
44 inside a function for array indexing. Take care of lvalue case
45 too. Assign.Emit just calls left.Emit since left knows everything
46 about the right side of the assigment after Resolve process.
47 * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
48 * BinaryOp.cs: renamed current_op to op as with the new
49 parser we no longer need to keep track of the old_op.
51 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
53 * expression.cs: do not pass the operand as a parameter to the
54 constructor as it gets after the parent gets constructed, same
55 with binary. Added code generation for array index access.
56 * Parser.cs: added ToJStoken which converts Token to JSToken,
57 factored the code for creation the Unary nodes. Take care of
59 * LateBinding.cs: back to Microsoft.JScript namespace.
62 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
64 * Parser.cs: pass the skip_count to ArrayLiteral constructor.
65 * Missing.cs: back to Microsoft.JScript namespace.
66 * ArrayLiteral.cs: added field skip_count, it tells us if this is
67 a spaced-arrayliteral, in which case we add a null value in the
68 list, added null check in the resolve and code generation process.
70 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
72 * expression.cs: added interface ICallable and and function AddArg
73 to class Call. Added class New.
74 * driver.cs: made it use the new lexer and parser.
75 * ast.cs: added field line_number, added property InFunction,
76 added class Function that factores all the code shared between
77 FunctionDeclaration and FunctionExpression.
78 * With.cs: constructor receives line number.
79 * VariableStatement.cs: constructor receives line number.
80 * VariableDeclaration.cs: Added check for parent being
81 FunctionDeclaration and FunctionExpression.
82 * Try.cs: Moved the code that used to take care of the catch to
83 Catch class. Constructor receives forming elements and line
84 number. Removed mangle_id.
85 * Throw.cs: constructor receives line number.
86 * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed
87 identifier to label in Continue and Break class, its constructor now
88 receives the label and line number. For class, constructor
89 receives its forming parts. Switch class, constructor receives
90 line number, added function AddClause and AddStm. Added class
91 Catch. Added class Labelled.
92 * SemanticAnalyser.cs: Added field anon_method_counter, properties
93 NextAnonymousMethod and CurrentAnonymousMethod.
94 * Parser.cs: function ArgumentList receives a ICallable list
95 instead of a AST. Now we add the arguments of a callable. Build
97 * Literal.cs: added constructor for 'this' literal and
98 ObjectLiteral constructor. Added RegExpLiteral class, will take
99 care of regular expressions semantic analysis and code generation.
100 * JSScanner.cs: use no more the antlr based lexer. Fix typo.
101 * JSParser.cs: make it use the new port of Rhino's Parser.
102 * FunctionObject.cs: Added constructor that receives the function name.
103 * FunctionExpression.cs: made it inherit from Function class. Added
104 constructor. Factored the code that used to set the prefix to
105 Function.set_prefix (it's shared with FunctionDeclaration). Added
106 fields local_script_func and field. Implemented Resolve and Emit
107 (now we can do: var x = function (this, method, is, anonymous) {... };).
108 * FunctionDeclaration.cs: made it inherit from Function class in
109 order to share code with FunctionExpression. Added new
110 constructor. Moved the code that used to built the prefix to
111 Function inside function set_prefix. When building the closure
112 added check for setting the type of a FunctionExpression. Moved
113 set_function_type and set_custom_attr to class Function.
114 * ForIn.cs: added constructor and fields lhs, obj and body.
115 * Block.cs: added default constructor and line number based
116 constructor. Check for elems not being null before adding.
117 * ArrayLiteral.cs: set elements in constructor.
119 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
121 * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
122 building the other block was not needed. Build the ast's for the
123 expressions and statements, keep track of the parent relationship.
125 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
127 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
128 Mozilla/Rhino's parser.
130 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
132 * jscript-lexer-parser.g: added ast building for object_literal,
133 it's disabled for now while I fix the "block Vs object_literal"
134 non-determinism problem on the parser. Added rule for
135 array_literal. Build PropertyName ast build.
136 * Literal.cs: fixed the negative numbers code generation (we must
137 optimize this). Added initial ObjectLiteral's class, code generation and
138 Resolve process. Added class ObjectLiteralItem and PropertyName.
139 * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
140 elisions we keep track of the "real" size here. Added constructor. Added initial
141 Resolve and Emit code.
142 * ASTList.cs: added Size property.
143 * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
145 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
147 * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
148 break and continue in order to jump to the desired place. Added
149 check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
150 * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
151 need to jump if the expression evaluates to true. Continue class,
152 replaced ParentIsItrStm with InLoop, emit jump to correct
153 place. Break class, implemented Resolve; deleted
154 ParentIsCorrect. DoWhile, While classes, set LoopBegin and
155 LoopEnd. While class, set LoopBegin and LoopEnd.
156 * ast.cs: Added InLoop and InSwitch.
157 * jscript-lexer-parser.g: pass parent to break_stm. Added block as
158 a statement. Temporarily disabled object_literal in order to test
159 the block structure and continue and break statements.
161 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
163 * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
164 property. Added initial pieces for Break's Resolve. Fixed bug that
165 did not let Emit the code for case clauses that came after the
166 default clause (we match the jsc behavior).
167 * jscript-lexer-parser.g: set parent of switch's clauses.
169 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
171 * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
172 * jscript-lexer-parser.g: set parent hierarchy for continue
173 statement. Set to correct parent in iteration_stm.
175 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
177 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
179 * Statement.cs: Added code generation support for 'switch' statement.
181 * jscript-lexer-parser.g: added 'using' for
182 System.Collections. Allow 'switch' statement building of its
183 ast. Added parent parameter to constructor of With. Build
186 * With.cs: code generation support for 'with' stm.
188 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
190 * Statement.cs: initial code generation of 'for'.
191 * jscript-lexer-parser.g: let's build for's ast.
193 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
195 * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
196 * expression.cs: handle Try case for field or local vars allocation.
197 * Try.cs: implemented Emit.
198 * Throw.cs: implemented code generation.
199 * FunctionDeclaration.cs: cache some values.
201 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
203 * FunctionDeclaration.cs: let's make function name formation
204 (get_name ()) a little bit less dumb. We cache the prefix now so
205 we don't have to recalculate it everytime.
207 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
209 * Literal.cs: emit the correct code for negative numbers.
210 * jscript-lexer-parser.g: set parent unary_expr.
212 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
214 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
215 * Statement.cs: Added code generation for while and do-while.
217 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
219 * Statement.cs (class if): reimplemented Emit based on fall_false.
220 * Equality.cs: added code generation for != and emit jumping code
221 only in the case we are at a global expression not statement.
222 * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
223 boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
225 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
227 * expression.cs (Binary.Emit): treat boolean operator
228 specially. Added emit_jumping_code.
229 * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
230 fall_false, which will express all boolean expressions and control
233 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
235 * Equality.cs: Moved the Emit and Resolve code here.
236 * jscript-lexer-parser.g: Build a Equality object instead of a
237 Binary object for equality_expr.
238 * expression.cs: moved equality oeprators (resolve and IL gen) to
239 Equality.Emit and Equality.Resolve.
241 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
243 * expression.cs: Added shift operators IL emit.
244 * BitwiseBinary.cs: added constructor for building it according to
245 JSToken enum. return a new object on EvaluateBitwiseBinary (this
246 needs a real implementation).
247 * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
249 * Statement.cs: added stub for While and DoWhile ast
250 representation (reworking my Emit code).
251 * jscript-parser-lexer.g: allow iteration statement ast build.
253 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
255 * expression.cs: added Modulo operator case.
257 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
259 * Convert.cs: added rule for string conversion.
261 * Plus.cs: added rule for string addition.
263 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
264 Emit (cases where there's no real operator).
266 * StringLiteral.cs: now implements Exp as can appear as a simple
267 exp in global code. Added check for Pop generation.
269 * expression.cs: added IL generation code for print func call.
270 Args class added get_element, Size and made Resolve behave as the
271 others (collect the differents Resolve's return values from each
272 of the arguments). Expression class, added default Resolve call
273 for non-Exp implementers.
275 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
276 AST, this handles the case where no postOrPrefixOp present; Unary
279 * FormalParameterList.cs: added get_element, retrieves nth element.
281 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
283 * ScriptStream.cs: let's print some messages.
285 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
287 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
289 * jscript-lexer-parser.g: keep track of return's parent.
290 * Statement.cs: added parent parameter to constructor.
292 * expression.cs: refactored Emit code from Identifier, now we take
293 care of function's paramenter references. First attack to function
294 calls, check if Resolve from Call succeed.
296 * VariableDeclaration.cs: Deleted Decl class, field_info and
297 local_builder fields were being used only by VariableDeclaration,
298 I'll keep them there.
300 * FormalParameterList.cs: added field pos to FormalParam, and set
301 it at FormalParameterList's Resolve stage.
303 * TODO: updated TODO.
305 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
307 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
309 * expression.cs: At class Conditional renamed fields. Class
310 Expression inherits from Exp as we must keep track if we must pop
311 the last value (this is for the comma operator), track the parent,
312 at Resolve we take care of the last value of the expression,
314 * VariableDeclaration.cs: updates needed because of EmitContext change.
316 * Statement.cs: added parent param to If constructor. Implement
317 Resolve and Emit for If statement.
319 * Relational.cs: Set parent. The boxing happens in the containing statement.
321 * FunctionDeclaration.cs: Added func_type field, will be used to determine the
322 type of the function we are generating (global function, method
323 from a class, etc) and attach to it the correct custom
324 attribute. Simplified the code for nested functions:
325 refactored the code so no code duplication is involved, now we
326 have only one function that retrieves the name of the function,
327 now create a new EmitContext for the body of the method.
329 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
330 current EmitContext's ILGenerator.
332 * Convert.cs: Do not throw the NotImplementedException anymore for
333 method ToBoolean, for now we always return false. This must get a
336 * CodeGenerator.cs: Deleted one of ILGenerator fields
337 from EmitContext, suffices using only one (more notes about the
338 change on the Functiondeclaration entry). Imitate jsc behavior for
339 compiled files names, aggregate the exe or dll extension after last dot.
341 * Block.cs: In order to implement the comma operator (i.e., expression,
342 assign_exp), we must track if our expressions are at a global
343 scope, in which case we must pop the last result too.
345 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
347 * Relational.cs: Initial generation of CIL for relational operators.
349 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
351 * jscript-lexer-parser.g: formal_param_list receives a parent too.
353 * SymbolTable.cs: added size and current_symbols properties.
355 * JSLocalField.cs: don't throw not ImplementedException from
356 constructor (same reason, testing purposes, must get implemented
359 * IdentificationTable.cs: added num_of_locals and current_locals properties.
361 * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
362 as fields. Not throw NotImplementedException for
363 JScriptFunctionDeclaration (testing purposes, must get implemeted
364 for real). Let's build our function closures! Added functions:
365 build_closure and build_closure_nested, build_local_fields. Keep
366 track of current parameters and locals defs.
368 * FormalParameterList.cs: made FormalParam inherit from
369 AST. Implement the Emit for parameters, yeah!
371 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
373 * Closure.cs: do not throw the exception (this allow me to run the
374 tests at mcs/jtests and check that at least i'm not generating
375 invalid CIL). Be aware that this must be really implemented.
377 * Block.cs: renamed field, and implement the double pass for
378 nested function declarations code emittion, yeah!.
380 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
382 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
383 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
384 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
385 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
386 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
388 * UnaryOp.cs: inherit from Exp now.
389 * Plus.cs: Don't throw the exception when calling constructor, let
390 it build the default handler. Return a new object when calling
391 EvaluatePlus until properly implemented.
393 * NumericUnary.cs: added new Resolve.
394 * NumericBinary.cs: assign operator val at ctr. Return a new
395 object when calling EvaluateNumericBinary until properly
396 implemented. Added Resolve.
397 * Equality.cs: added ctr and return false for EvaluateEquality
398 until properly implemented. Added Resolve's functions.
400 * Block.cs (Resolve): That check was not necessary.
402 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
403 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
404 BinaryOp and UnaryOp, and this from Exp.
405 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
406 * jscript-lexer-parser.g: deleted debugging messages. Create a
407 Assign object instance of a simple Binary obj. Same case for Equality.
409 * expression.cs: added Exp abstract class. Classes that are ast of
410 language constructions that can appear as global expressions that
411 get evaluated and then the result is discarded inherit from this
412 new class. This let meee keep track of things that must get Popped
413 or can even avoid the evaluation of it. Wrote real Resolve method
414 for classes: Unary, Binary.
415 Implemted Emit method for some binary operations (+, -, / and *),
416 for other operators some more code is still missing.
417 Identifier: handle assignment cases and global exp cases.
418 Added class Assign (compisite assignment still missing tough :-(
420 * driver.cs: deleted debug messages, added "Compilation Succeeded"
422 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
423 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
424 Exp and handle the case for global expressions that must be popped
425 after evaluation. no more invalid IL being generated! yeah!
426 * Block.cs: wrote real Resolve method, erased debug messages.
427 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
428 * BinaryOp.cs, Conditional: now inherits from Exp.
430 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
432 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
434 * CodeGenerator.cs: small fixes to generate same things that ms.
436 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
438 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
440 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
442 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
444 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
446 * jscript-lexer-parser.g: keep track of parent reference for
447 IDENTIFIER, STRING_LITERAL.
449 * expression.cs: Added 'binding' field. Added 'parent' parameter
450 to constructor. Now we emit the proper code for the identifier.
452 * VariableStatement.cs: updated to field names instead of the old
455 * VariableDeclaration.cs: Added class Decl, it constains the
456 references to the static field or LocalBuilder that are created
457 when a declaration is emitted. Deleted unuseful properties (Id,
460 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
461 object instead of a boolean.
463 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
465 * IdentificationTable.cs: Deleted Retrieve method. Contains method
466 now return an object instead of a boolean, that reference is the
467 binding associated with the identifier being searched.
469 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
471 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
473 * VariableDeclaration.cs: now I handle initialization (ex. var x =
474 2; or function f () { var x = 4; }) at global scope or at
477 * Literal.cs: Added parent param to NumericLiteral constructor.
479 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
481 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
483 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
485 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
487 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
488 "instanceof"; }' in order to be able to parse both keywords. When
489 generating the parser, one warning about nondeterminism
490 (k==1:"in") is generated ignore it.
492 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
494 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
495 not parsable now they are. Mozilla's and Janet's test suites are
496 being really helpful.
498 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
500 * jscript-lexer-parser.g: added check for non-null reference at
501 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
502 and multiple lines comments rule.
504 * jscript-lexer-parser.g: Now I keep track of the parent for most
505 of the syntatic constructs. Fixed object_literal rule.
507 * ast.cs: Added field parent. This will help me to track nested
508 blocks for all of the syntatic constructs and will allow to Emit
509 everything in one single pass.
510 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
512 * Block.cs, FunctionObject.cs: deleted parent field as AST will
513 hold it. Delete parent parameter from constructor.
514 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
515 EmitContext class. The idea is Emitting everything in one pass (decls
516 and 'Global Code' method, the parent reference let me know which IL
517 generator use, gc_ig or ig).
518 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
519 constructor. Use new parent reference for choosing the IL
520 generator. NumericLiteral a 'hard coded' int32 IL emittion added
522 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
523 the parent reference to infere which IL generator to use.
524 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
525 reference to infer which IL generator to use.
526 * expression.cs: Added paramenter parent to constructor of: Unary,
527 Binary, Conditional, Call.
529 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
531 * expression.cs: Added new field to Call class, so it can handle more arguments.
533 * StringLiteral.cs (Emit) : Load the string value.
535 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
537 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
538 custom attribute. Build default 'JScript 0' constructor. Emit
539 default initial/final code of 'Global Code'. Create default
542 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
544 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
545 repeating hand written rule all around. Change "." for DOT, dumb
546 mistake by myself. Added rule new_expr. Now we handle properly the
547 call_expr rule (as defined on the spec), and added a new
548 argument. Added subrule new_expr to left_hand_side_expr rule.
550 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
552 * expression.cs (Expression): implemented Emit.
554 * expression.cs (Binary): Emit now creates a local for the
555 different kinds of binary expressions (initial code for this).
557 * ast.cs: Emit method now is abstract instead of virtual.
559 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
561 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
562 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
563 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
564 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
565 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
566 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
567 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
568 Conditional, Call, Identifier, Args, Expression, :
571 * FunctionDeclaration.cs: Check if values are not null first (at
572 Resolve). Ignore code generation is at 'Global Code'.
574 * VariableDeclaration.cs: Now I take care of IL generation when we
575 are at statements and expressions at global code, 'Global Code'
576 method is populated with that IL.
578 * CodeGenerator.cs: Added flag for 'Global Code' method
579 emittion. Now I call 'Emit' twice. The first for declarations the
580 follower for statements and expressions at global scope.
582 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
584 * Visitor.cs: Deleted.
586 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
588 * FormalParameterList.cs: Now inherits from AST. Each of the
589 formal parameters gets into the IdentificationTable at Resolve.
591 * FunctionDeclaration.cs:Resolve (), We open a new block when
592 encountering a FunctionDeclaration, resolve de parameters and the
593 body, at the end we close the block.
595 * IdentificationTable.cs: Now we keep track of parent of the
596 current block. 'Enter (...)' now receives an object, not a
597 VarDecl. 'Contains' now take care of searching through the binding
600 * Literal.cs: Deleted 'Literal' class, was being used for
601 nothing. All the classes the inherited from it, now do it from
602 AST. A 'literal' does resolve to true by default.
604 * Relational.cs: Resolve recursively left and right.
606 * SemanticAnalyser.cs: added flag for 'print statement'.
608 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
611 * driver.cs: Init the semantic analysis phase.
613 * expression.cs: 'Unary' class, resolves its operand
614 first. 'Binary' class,resolves left and right first. 'Args' class
615 resolve all the formal parameters first. 'Expression' resolve all
616 the nested expressions first.
618 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
620 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
622 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
623 this is temporal in order to get Factorial compiled by mjs (must
624 build the types according to Ecma-262 spec).
626 * Literal.cs: Added NumericLiteral class.
628 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
630 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
631 if inside a nested block.
633 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
635 * jscript-lexer-parser.g: Now we take care of parents. This allows
636 to keep track if we are inside nested blocks. At
637 'func_decl_or_expr', now I built the FunctionDeclaration or
638 FunctionExpression first and then assign its body to it - this let
639 me get a non-null value of the FunctionExpression or
640 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
642 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
643 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
644 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
646 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
648 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
649 (gets the name of a function if it's nested). Emit code for
650 function's body. At 'Emit ()' now we take care if it's a nested
653 * FunctionObject.cs: default return type is 'void' not
654 'Object'. Function declarations without parameters map to functions with
655 'Object this' and 'VsaEngine engine' as parameters by
656 default. Assign parent to nested block.
658 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
659 a global declaration or inside a function declaration.
661 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
663 * FunctionObject.cs: Handle no parameters on functions.
665 * jscript-lexer-parser.g: Allow functions without parameters.
667 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
669 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
670 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
671 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
672 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
673 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
674 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
675 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
676 With.cs, expression.cs : Added
677 'Resolve' method stub.
679 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
681 * FormalParameterList.cs: Added FormalParam class. Change Add
682 method to receive the id and the type annotation from function's parameters.
684 * FunctionDeclaration.cs: Added code for initial function's
685 definition code generation.
687 * FunctionObject.cs: Added MethodAttributes and type_annot
688 fields. Added params_types function, which returns an array of
689 types from each of the function's parameters.
691 * IdentificationTable.cs: Added ToString method.
693 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
694 and add it again with the correct name). Not based on the Visitor
695 pattern anymore. Deleted all the VisitFOO methods. Added a
696 IdentificationTable field. Added Run, Dump methods.
698 * Statement.cs: Deleted Statement class (it was being used for
699 nothing). All classes that were having Statement as parent,
700 changed their parent to be AST.
702 * SymbolTable.cs: Added Add method that receives the id and the
703 declaration class. Retrieve changed to return an AST. Added
704 ToString method. Added 'SymbolTable parent' field.
706 * VariableDeclaration.cs: Added InitValue property.
708 * ast.cs: Added some comments and abstract method 'Resolve'.
710 * jscript-lexer-parser.g: Added parsing support for formal
711 parameters type annotations.
713 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
715 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
718 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
720 * jscript-lexer-parser.g: allow empty program files. Added type
721 annotations on var decl and function decl.
722 * VariableDeclaration.cs: added return type annotation field.
723 * FunctionExpression.cs: added return type parameter to constructor.
724 * FunctionDeclaration.cs: added return type parameter to
725 constructor. Added Emit method (just creates the static field at
726 the global object, for now).
727 * FunctionObject.cs: added return type to constructor. Changed
728 names to readable ones ;-)
730 * ScriptStream.cs: added WriteLine.
732 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
734 * ast.cs: Added 'virtual' Emit method (I might change it to be
735 abstract, but I would have to added to all classes that derive
736 from it. I'll do it later)
737 * Block.cs: Added Emit method.
738 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
739 anymore) - still missing some methods, ut on the way. A nice
740 hacking weekend coming. Added EmitContext class.
741 * ScriptBlock.cs: Added Emit method.
742 * VariableDeclaration.cs: Changed type field from string to
743 Type. Added Emit method.
744 * VariableStatement.cs: Added Emit method.
745 * driver.cs: Added CodeGeneration phase (only simple var
746 declarations support it. More coming soon).
749 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
751 * statement.cs: added Return class.
753 * Throw.cs: Added expression field, constructor and ToString.
755 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
758 * With.cs: added constructor and ToString. Back to the non-tmp
761 * jscript-parser-lexer.g: allow with_stm tree building.
763 * jscript-lexer-parser.g: changed the return type from if_stm from
764 'If' to AST. Added tree for continue_stm. Allowed building of
767 * statement.cs: switched to internal 'If' class. Added Continue
768 class. Added Break class.
770 * jscript-lexer-parser.g: build tree for function decl or expr.
772 * FunctionDeclaration.cs: added internal constructor.
774 * FunctionExpression.cs: added internal constructor.
776 * FunctionObject.cs: added internal constructor and ToString method.
778 * jscript-lexer-parser.g: added building tree for if_stm.
779 * Statement.cs: Added if class for 'if' statement.
782 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
784 * VariableDeclaration.cs: added the initializer to ToString.
786 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
789 * Block.cs, Equality.cs, Relational.cs: modified ToString
791 * Equality.cs, Relational.cs, StringLiteral.cs,
792 VariableDeclaration.cs: Added constructor
794 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
795 name convetion style to mono style.
797 * UnaryOp.cs: added operator and operand fields.
799 * VariableDeclaration.cs: chenged field name from assignExp to val.
801 * BinaryOp.cs: Made "internal" the attributes, added the two
804 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
806 * driver.cs: Dump the string representation of the parsed exps.
808 * Literal.cs: added BooleanLiteral
810 * Relational.cs: added constructor, ToString,
812 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
814 * README: added some info about hacking the grammar
816 * JSparser.cs: Updated the constructor to not receiving params.
818 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
819 JScriptParserTokenTypes.txt: update of antlr generated files from
822 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
823 can parse a little bit more useful programs like:
825 function factorial (i)
832 k = factorial (i - 1);
841 As you can see, it's not the classic factorial function
842 definition, I still have to make some tricks like storing the
843 result from the recursive call and then multiply. But this new
844 grammar it's easier to alter than the old one. Also we got support
845 for for-in statements, for statements, global expressions, support
846 for object accesors or better known as the "dot" operator. Two
847 rules are on the eye: left_hand_size_expr and call_expr, in order
848 to finish the parsing grammar and fix the bugs.
851 2003-09-29 <cesar@ciencias.unam.mx>
853 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
855 * Added VsaItem.cs, implements IVsaItem.
857 2003-09-28 <cesar@ciencias.unam.mx>
859 * VsaItems.cs: Check that no name is repeated (this was docs fault
860 :-)). This is the beauty of testing.
862 * Add VsaItems.cs, implements IVsaItems.
864 2003-09-22 <cesar@ciencias.unam.mx>
866 * DocumentContext.cs: changed constructor from internal to public,
867 this a kind of hack ;), but we can build mjs.exe with that change.
869 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
870 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
871 StringLiteral.cs, StringConstructor.cs, Statement.cs,
872 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
873 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
874 Package.cs, ObjectConstructor.cs, NumberObject.cs,
875 NumberConstructor.cs, MathObject.cs, Literal.cs,
876 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
877 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
878 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
879 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
880 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
881 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
882 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
883 ErrorConstructor.cs, EnumeratorObject.cs,
884 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
885 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
886 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
887 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
888 ActiveXObjectConstructor.cs, ActivationObject.cs:
890 indentation comformance to mono style. Returned to
891 Microsoft.JScript namespace name. Now we can build
892 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
893 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
894 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
895 about the namespace stuff, because I want people
896 to contribute NUnit tests for Microsoft.JScript public API.
898 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
900 2003-09-21 <cesar@ciencias.unam.mx>
902 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
904 2003-09-20 <cesar@ciencias.unam.mx>
906 * jscript-lexer-parser.g: We are little bit closer to the spec on
907 StringLiteral definition.
909 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
911 * jscript-lexer-parser.g: Build ast for FunctionExpression.
913 * JSObject.cs: we don't throw NotImplementedException anymore,
914 this let us use FunctionExpression to build the ast.
916 * FunctionExpression.cs: Added a FunctionObject as field, a
919 * FunctionObject.cs: Added default constructor.
921 * driver.cs: Deleted the Jsc class. We are not generating code
922 now. I'm moving to provide something like mcs's EmitContext
923 instead of the CodeGenerator class having the Reflection.Emit
924 builders and ILGenerator. This driver is just for Lexical and
925 Parsing phases testing.
927 * driver.cs: Now we are using the Microsoft.JScript public API
928 functions to load the lexer and parser.
930 * ScriptBlock.cs,Block.cs: Added ToString function.
932 2003-09-20 <cesar@ciencias.unam.mx>
934 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
935 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
936 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
937 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
938 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
939 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
940 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
941 : erased Visit method and made some mono indentation style changes.
943 * CodeGenerator.cs: commented some function calls.
944 * FunctionDeclaration.cs: moved function attributes to
945 FunctionObject class, erased Visit method.
946 * FunctionObject.cs: Here is where we store a function
947 expression/declaration info, erased Visit method.
948 * ScriptBlock.cs: Added a Block field, Block will contain the
950 * jscript-lexer-parser.g: updated the grammar to build the program
951 representation based on ScriptBlock.
953 2003-09-19 <cesar@ciencias.unam.mx>
955 * JSToken.cs: public API compliance.
957 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
959 * Context.cs: Added constructor and Document field.
960 * DocumentContext.cs: Added Name field.
961 * JSParser.cs: Integration of antlr's generated parser with
962 JSParser public API. ScriptBlock is now the principal data structure that
963 represents a Jscript .Net program.
964 * JSScanner.cs: Integration of antlr's generated lexer with
965 JSScanner public API.
967 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
968 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
970 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
972 * jscript-lexer-parser.g: Changed the namespace to
973 Microsoft.JScript.Tmp.
975 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
977 * jscript-lexer-parser.g: Got the name of a
978 global_function_declaration and also its return type if
981 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
982 * jscript-lexer-parser.g: Initial construction of AST for
983 enum_statement and package_statement.
985 * jscript-lexer-parser.g: Fixed the enum_statement to accept
986 empty enum declarations.
988 * jscript-lexer-parser.g: Got the type of a
989 veriable_declaration.
991 * jscript-lexer-parser.g: Initial construction of AST for
992 primary_expression (in particular literal).
995 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
997 * driver.cs: Modified the driver structure to be compatible
998 with our new CodeGenrator and SemanticAnalizer. I
999 removed the builders from Reflection.Emit to the
1000 CodeGenerator. Added an ASTList, SemanticAnalizer and
1001 CodeGenerator here. Adde methods Run, GenerateCode
1004 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1005 * Statement.cs: Forgot to include it on last commit.
1007 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1009 * Decided to change temporarly namespace name
1010 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
1011 to run the code generated by our CIL code generator (on next
1012 commit will come). The problem is that we don't have the
1013 runtime support for our compiler, this involve VsaEngine class
1014 and its "friends", which I have not found a lot of
1015 doumentation for. If someone knows a docs place for them,
1016 don't hesitate to send me a email pointing to them.
1018 * Changed from public to internal Visit function at some
1021 * Package.cs: Added Name and Members fields.
1023 * SemanticAnalizer.cs: Added methods VisitPrint and
1026 * VariableDeclaration.cs: Added Type field.
1028 * Visitor.cs: Changed from public to internal. Added
1029 VisitPrint and VisitStringLiteral methods.
1031 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
1032 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
1037 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1039 * Added CmdLineError.cs and JSError.cs, last night I forgot to
1042 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1044 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
1045 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
1046 CmdLineException.cs, CmdLineOptionParser.cs,
1047 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
1048 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
1049 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
1050 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
1051 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
1052 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
1053 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
1054 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
1055 LenientDateConstructor.cs, LenientDatePrototype.cs,
1056 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
1057 LenientFunctionPrototype.cs, LenientMathObject.cs,
1058 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
1059 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
1060 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
1061 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
1062 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
1063 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
1064 PostOrPrefixOperator.cs, RangeErrorObject.cs,
1065 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
1066 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
1067 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
1068 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
1069 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
1070 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
1071 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
1072 VersionableAttribute.cs
1074 Now, I must fill in the blanks :-)
1077 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1078 * jscript-lexer-parser.g: Added conditional_compilation_directive,
1079 which is the beginning of our support for conditional compilation
1080 statements and directives in our parser. Added
1081 cc_on_statement, and some lexer rules for getting the needed
1082 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
1083 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
1086 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1088 * jscript-lexer-parser.g: Changed the format of copyright notice.
1090 This changes will allow the support
1091 for the grammar added by MS to EcmaScript (aka its JScript .Net),
1092 I'm still missing some, but they are on the way.
1094 * jscript-lexer-parser.g: Deleted function_declaration, and
1095 added global_function_declaration and type_function_declaration.
1096 I decided to make the grammar as strict as the MS docs mark,
1097 but there's a difference between what their docs says and what
1098 their compiler does. For this case I decided to follow the
1099 docs. A program like:
1100 private function F ()
1102 according to the docs, would not be syntaticly correct. But the MS
1103 compiler, accepts the grammar construct and mark the error at
1104 semantic analysis phase. I followed the docs this time.
1106 * jscript-lexer-parser.g: Added debbuger_statement.
1107 * jscript-lexer-parser.g: Added import_statement.
1108 * jscript-lexer-parser.g: Added package_statement and package_member(s).
1109 * jscript-lexer-parser.g: Added super_statement.
1110 * jscript-lexer-parser.g: Added const_statement.
1111 * jscript-lexer-parser.g: Added class_statement,
1112 interfaces_list and class_members.
1114 * jscript-lexer-parser.g: Added interface_statement and
1117 * jscript-lexer-parser.g: Added enum_statement.
1118 * jscript-lexer-parser.g: Added static_statement. The rule for
1119 this syntatic construc is: static identifier { [body] }
1120 body does not get well specified in the docs. Must search wich
1121 are the possible values of it.
1123 * jscript-lexer-parser.g: At variable_declaration, added
1124 support for explicit type declaration.
1126 * jscript-lexer-parser.g: Added numeric_literal,
1127 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1129 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1132 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1135 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1136 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1137 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
1140 That method will be the driver that will allow classes
1141 that implement the Visitor interface do a walk through the AST's
1142 elements, in particular the Semantic Analizer and the Code
1143 Generator. Every class that inherits from AST will have a Visit
1144 method, that method will receive a Visitor and a object as
1145 parameters, the only thing that it'll do is letting the Visitor
1146 call the respective method VisitX, where X is the name of the
1147 currently visited class.
1149 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
1151 * FunctionDeclaration.cs: Added constructor, Visit and ToString
1154 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
1155 program (the main entry of the parser). Also added as parameters:
1156 - An AST to source_element.
1157 - A Statement to statement.
1158 - A VariableStatement to variable_statement.
1159 - A VariableStatement to variable_declaration_list.
1160 - A FormalParamerList by formal_parameter_list.
1161 - A ASTList by function_body.
1163 And now some rules return objects:
1164 - A VariableDeclaration by variable_declaration.
1165 - A Functiondeclaration by function_declaration.
1167 * driver.cs: Added the construction of the AST of the EcmaScript
1170 * Visitor.cs: Added this file. It's the visitor interface.
1172 * VariableDeclaration.cs: Added this class, it's the AST
1173 representation of a variable declaration.
1175 * Statement.cs: Added this file. It's the logical representation
1178 * VariableStatement.cs: Added this class. It's the AST
1179 representation of a chain of variable declarations.
1181 * FormalParameterList.cs: The function declaration needs to store
1182 its parameter, we will put them on this class.
1184 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
1185 implement the semantic analysis and code generation
1186 phases. SemanticAnalizer and CodeGenerator will implement the
1187 Visitor interface, they will walk a program's
1188 AST tree and do their respective work.
1190 * IdentificationTable.cs: Added this class. The SymbolTable will be used
1191 by the SemanticAnalyzer in order to keep track of the variable
1192 declaration encountered, etc..
1194 * SymbolTable.cs: A simple hashtable but for commodity i'll call
1198 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1200 * jscript-lexer-parser.g:
1201 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
1202 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
1203 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
1204 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
1205 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
1206 - Changed INTERROGATION to CONDITIONAL.
1207 - Changed TRIANGLE to BITWISE_XOR.
1208 - Changed SLASH to DIVISION.
1209 - Changed PERCENT to REMAINDER.
1210 - Changed ADMIRATION to LOGICAL_NOT
1211 - Added BITWISE_NOT (~).
1212 - Added the INCREMENT and DECREMENT rules for
1213 left_hand_side_expression.
1214 - Increased lexer lookup from 2 to 4.
1215 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
1216 BITWISE_AND, BITWISE_OR,
1217 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
1218 REMAINDER, UNSIGNED_RIGHT_SHIFT.
1219 - Added the recursion rules for equality_expression.
1220 - Added the recursion rules for shift_expression.
1222 - The most important thing, added support for expressions like:
1225 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1228 - Erased the Context class, it was used for the first
1229 test of the print_statement and Reflection.Emit. As I erased the
1230 Program, SourceElements, SourceElement from the ANTLR grammar (for
1231 the rework of the AST tied to the MS JScript public API), I erased
1233 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1234 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1235 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1238 * jscript-lexer-parser.g:
1239 - Erased the references to the classes Program, SourceElements,
1240 SourceElement, Statement, FunctionDeclaration and erased
1241 print_statement rule.
1243 * JSCriptLexer.cs JScriptParser.cs and the other files generated
1244 by antlr, reflect changes from the grammar changes.
1246 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1247 * Added stubs for the classes:
1250 ActiveXObjectConstructor.cs
1254 AssemblyCustomAttributeList.cs
1259 BooleanConstructor.cs
1267 EnumeratorConstructor.cs
1273 FunctionConstructor.cs
1274 FunctionDeclaration.cs
1275 FunctionExpression.cs
1279 IActivationObject.cs
1285 JSFunctionAttribute.cs
1286 JSFunctionAttributeEnum.cs
1291 LenientGlobalObject.cs
1293 NumberConstructor.cs
1295 ObjectConstructor.cs
1297 RegExpConstructor.cs
1302 StringConstructor.cs
1307 VBArrayConstructor.cs
1312 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1314 * jscript-lexer-parser.g:
1315 - Added rules for: continue_statement, break_statement,
1316 return_statement, throw statement (all of them do not ensure that
1317 no LineSeparator appears between the keyword on the left and the
1318 identifier, expression or semicolon on the right, that must be fixed).
1319 - Added single line comments rule.
1321 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1323 * jscript-lexer-parser.g: Added syntatic rule for:
1325 - while and for-in subrules of iteration_statement.
1326 - Added array_literal - got tricky - I just could get the simplest rule going :)
1330 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1332 * jscript-lexer-parser.g:
1333 - Syntatic rule for iteration_statement.
1334 - "do" subrule for it.
1335 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
1336 "in") relational_expression | ) rule to relational_expression.
1337 -Added function_expression syntatic rule.
1338 - Added STRING_LITERAL to literal rules.
1339 - "Less/Greater or equal than" lexer rule.
1341 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1343 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
1345 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1347 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1350 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1352 * Added a README file. Explains the dependencies and build process.
1354 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1356 * Added this ChangeLog file.
1358 * ast.cs: Added this file. Contains the classes used for building
1359 the EcmaScript 's AST.
1361 * JScript*: These are the files generated by antlr (the parser generator).
1363 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
1365 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
1366 that will be moved to other file in the future.
1368 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.