1 2004-10-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
3 * StringObject.cs: add value field
5 * expression.cs: implement LateBinding. Added methods:
6 emit_late_binding, init_late_binding, emit_late_get_or_set,
7 get_global_scope_or_this, setup_late_call_args, load_script_func, emit_late_call
8 * Convert.cs: implement CheckIfDoubleIsInteger and CheckIfSingleIsInteger
10 2004-10-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
12 * ast.cs (Function): added method emit_return_local_field, if
13 there's a return stm inside a function we must allocate a
14 JSLocalField indicating the return type of the function.
15 * FunctionDeclaration.cs, FunctionExpression.cs: generate the
16 extra JSLocalField if needed
18 2004-10-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
20 * Parser.cs: set the operator properly.
22 2004-10-11 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
24 * GlobalObject.cs: ported encodeURI, encodeURIComponent,
25 decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode.
27 * expression.cs (Call.Emit): implement IsConstructorProperty.
29 2004-10-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
31 * expression.cs: added support for function calls. Handle case of
32 print where no args are supplied.
34 2004-10-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
36 * ast.cs: added GetContainerFunction property.
37 * Statement.cs: added class NotVoidReturnEventArgs and delegate
38 NotVoidReturnEventHandler, throw an event in case we find a
39 return, the enclosing function object takes care of changing the
40 return type of the function.
41 * FunctionDeclaration.cs, FunctionExpression.cs: take care of
42 return's inside functions.
44 2004-09-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
46 * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField.
48 * Parser.cs: use ToJSToken to set the operator properly.
49 * FunctionDeclaration.cs: delete spaces.
51 2004-09-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
53 * FunctionDeclaration.cs: check for parent being a ScriptBlock.
55 2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
57 * expression.cs: added semantic analysis for accessing fields on
58 class Binary. Semantic Analysis for Calls it takes care of
59 constructors and methods, added invocation code for built in
60 methods. Added interface IAccesible that let us resolve the '.'
61 operator. Class Args handles missing or surplus arguments. Added
62 class BuiltIn which will take care of all builtins of ECMAScript.
63 * ast.cs: added check for parent equal to ScriptBlock.
64 * SymbolTable.cs: added method Remove.
65 * Statement.cs: Added abstract class Jump of which Continue and
66 Break inherit, checks the label stuff. Added checks for Label
67 stuff to Continue and Break classes. Added method Init for
68 DoWhile. Fixes for loops statements in order to be able for have
69 nested loops. Initial support for Label statements.
70 * SemanticAnalizer.cs: added hash global_env and
71 IdentificationTable label_set for keeping track of global methods and
72 label sets. Added static constructor, method BuildGlobalEnv,
73 ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel,
74 GetLabel, RemoveLabel.
75 * Relational.cs: added code generation for ops instanceof and
76 in. Fixes for usual relational ops.
77 * Parser.cs:fixes to keep track of the inheritance chain.
78 * MathObject.cs: added internal constructor.
79 * JSFunctionAttribute.cs: added fields value and built_in_function
80 so we can decide when a method is really a built in.
81 * IdentificationTable.cs: added method Remove.
82 * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression.
84 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
86 * expression.cs: made Binary is IAssignable, added fields assign
87 and right_side, added method ResolveAssign (which now receives an
88 extra parameter, being the right side of the assigment). Take care of being
89 inside a function for array indexing. Take care of lvalue case
90 too. Assign.Emit just calls left.Emit since left knows everything
91 about the right side of the assigment after Resolve process.
92 * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
93 * BinaryOp.cs: renamed current_op to op as with the new
94 parser we no longer need to keep track of the old_op.
96 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
98 * expression.cs: do not pass the operand as a parameter to the
99 constructor as it gets after the parent gets constructed, same
100 with binary. Added code generation for array index access.
101 * Parser.cs: added ToJStoken which converts Token to JSToken,
102 factored the code for creation the Unary nodes. Take care of
104 * LateBinding.cs: back to Microsoft.JScript namespace.
107 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
109 * Parser.cs: pass the skip_count to ArrayLiteral constructor.
110 * Missing.cs: back to Microsoft.JScript namespace.
111 * ArrayLiteral.cs: added field skip_count, it tells us if this is
112 a spaced-arrayliteral, in which case we add a null value in the
113 list, added null check in the resolve and code generation process.
115 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
117 * expression.cs: added interface ICallable and and function AddArg
118 to class Call. Added class New.
119 * driver.cs: made it use the new lexer and parser.
120 * ast.cs: added field line_number, added property InFunction,
121 added class Function that factores all the code shared between
122 FunctionDeclaration and FunctionExpression.
123 * With.cs: constructor receives line number.
124 * VariableStatement.cs: constructor receives line number.
125 * VariableDeclaration.cs: Added check for parent being
126 FunctionDeclaration and FunctionExpression.
127 * Try.cs: Moved the code that used to take care of the catch to
128 Catch class. Constructor receives forming elements and line
129 number. Removed mangle_id.
130 * Throw.cs: constructor receives line number.
131 * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed
132 identifier to label in Continue and Break class, its constructor now
133 receives the label and line number. For class, constructor
134 receives its forming parts. Switch class, constructor receives
135 line number, added function AddClause and AddStm. Added class
136 Catch. Added class Labelled.
137 * SemanticAnalyser.cs: Added field anon_method_counter, properties
138 NextAnonymousMethod and CurrentAnonymousMethod.
139 * Parser.cs: function ArgumentList receives a ICallable list
140 instead of a AST. Now we add the arguments of a callable. Build
142 * Literal.cs: added constructor for 'this' literal and
143 ObjectLiteral constructor. Added RegExpLiteral class, will take
144 care of regular expressions semantic analysis and code generation.
145 * JSScanner.cs: use no more the antlr based lexer. Fix typo.
146 * JSParser.cs: make it use the new port of Rhino's Parser.
147 * FunctionObject.cs: Added constructor that receives the function name.
148 * FunctionExpression.cs: made it inherit from Function class. Added
149 constructor. Factored the code that used to set the prefix to
150 Function.set_prefix (it's shared with FunctionDeclaration). Added
151 fields local_script_func and field. Implemented Resolve and Emit
152 (now we can do: var x = function (this, method, is, anonymous) {... };).
153 * FunctionDeclaration.cs: made it inherit from Function class in
154 order to share code with FunctionExpression. Added new
155 constructor. Moved the code that used to built the prefix to
156 Function inside function set_prefix. When building the closure
157 added check for setting the type of a FunctionExpression. Moved
158 set_function_type and set_custom_attr to class Function.
159 * ForIn.cs: added constructor and fields lhs, obj and body.
160 * Block.cs: added default constructor and line number based
161 constructor. Check for elems not being null before adding.
162 * ArrayLiteral.cs: set elements in constructor.
164 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
166 * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
167 building the other block was not needed. Build the ast's for the
168 expressions and statements, keep track of the parent relationship.
170 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
172 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
173 Mozilla/Rhino's parser.
175 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
177 * jscript-lexer-parser.g: added ast building for object_literal,
178 it's disabled for now while I fix the "block Vs object_literal"
179 non-determinism problem on the parser. Added rule for
180 array_literal. Build PropertyName ast build.
181 * Literal.cs: fixed the negative numbers code generation (we must
182 optimize this). Added initial ObjectLiteral's class, code generation and
183 Resolve process. Added class ObjectLiteralItem and PropertyName.
184 * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
185 elisions we keep track of the "real" size here. Added constructor. Added initial
186 Resolve and Emit code.
187 * ASTList.cs: added Size property.
188 * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
190 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
192 * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
193 break and continue in order to jump to the desired place. Added
194 check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
195 * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
196 need to jump if the expression evaluates to true. Continue class,
197 replaced ParentIsItrStm with InLoop, emit jump to correct
198 place. Break class, implemented Resolve; deleted
199 ParentIsCorrect. DoWhile, While classes, set LoopBegin and
200 LoopEnd. While class, set LoopBegin and LoopEnd.
201 * ast.cs: Added InLoop and InSwitch.
202 * jscript-lexer-parser.g: pass parent to break_stm. Added block as
203 a statement. Temporarily disabled object_literal in order to test
204 the block structure and continue and break statements.
206 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
208 * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
209 property. Added initial pieces for Break's Resolve. Fixed bug that
210 did not let Emit the code for case clauses that came after the
211 default clause (we match the jsc behavior).
212 * jscript-lexer-parser.g: set parent of switch's clauses.
214 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
216 * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
217 * jscript-lexer-parser.g: set parent hierarchy for continue
218 statement. Set to correct parent in iteration_stm.
220 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
222 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
224 * Statement.cs: Added code generation support for 'switch' statement.
226 * jscript-lexer-parser.g: added 'using' for
227 System.Collections. Allow 'switch' statement building of its
228 ast. Added parent parameter to constructor of With. Build
231 * With.cs: code generation support for 'with' stm.
233 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
235 * Statement.cs: initial code generation of 'for'.
236 * jscript-lexer-parser.g: let's build for's ast.
238 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
240 * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
241 * expression.cs: handle Try case for field or local vars allocation.
242 * Try.cs: implemented Emit.
243 * Throw.cs: implemented code generation.
244 * FunctionDeclaration.cs: cache some values.
246 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
248 * FunctionDeclaration.cs: let's make function name formation
249 (get_name ()) a little bit less dumb. We cache the prefix now so
250 we don't have to recalculate it everytime.
252 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
254 * Literal.cs: emit the correct code for negative numbers.
255 * jscript-lexer-parser.g: set parent unary_expr.
257 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
259 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
260 * Statement.cs: Added code generation for while and do-while.
262 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
264 * Statement.cs (class if): reimplemented Emit based on fall_false.
265 * Equality.cs: added code generation for != and emit jumping code
266 only in the case we are at a global expression not statement.
267 * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
268 boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
270 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
272 * expression.cs (Binary.Emit): treat boolean operator
273 specially. Added emit_jumping_code.
274 * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
275 fall_false, which will express all boolean expressions and control
278 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
280 * Equality.cs: Moved the Emit and Resolve code here.
281 * jscript-lexer-parser.g: Build a Equality object instead of a
282 Binary object for equality_expr.
283 * expression.cs: moved equality oeprators (resolve and IL gen) to
284 Equality.Emit and Equality.Resolve.
286 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
288 * expression.cs: Added shift operators IL emit.
289 * BitwiseBinary.cs: added constructor for building it according to
290 JSToken enum. return a new object on EvaluateBitwiseBinary (this
291 needs a real implementation).
292 * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
294 * Statement.cs: added stub for While and DoWhile ast
295 representation (reworking my Emit code).
296 * jscript-parser-lexer.g: allow iteration statement ast build.
298 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
300 * expression.cs: added Modulo operator case.
302 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
304 * Convert.cs: added rule for string conversion.
306 * Plus.cs: added rule for string addition.
308 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
309 Emit (cases where there's no real operator).
311 * StringLiteral.cs: now implements Exp as can appear as a simple
312 exp in global code. Added check for Pop generation.
314 * expression.cs: added IL generation code for print func call.
315 Args class added get_element, Size and made Resolve behave as the
316 others (collect the differents Resolve's return values from each
317 of the arguments). Expression class, added default Resolve call
318 for non-Exp implementers.
320 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
321 AST, this handles the case where no postOrPrefixOp present; Unary
324 * FormalParameterList.cs: added get_element, retrieves nth element.
326 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
328 * ScriptStream.cs: let's print some messages.
330 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
332 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
334 * jscript-lexer-parser.g: keep track of return's parent.
335 * Statement.cs: added parent parameter to constructor.
337 * expression.cs: refactored Emit code from Identifier, now we take
338 care of function's paramenter references. First attack to function
339 calls, check if Resolve from Call succeed.
341 * VariableDeclaration.cs: Deleted Decl class, field_info and
342 local_builder fields were being used only by VariableDeclaration,
343 I'll keep them there.
345 * FormalParameterList.cs: added field pos to FormalParam, and set
346 it at FormalParameterList's Resolve stage.
348 * TODO: updated TODO.
350 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
352 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
354 * expression.cs: At class Conditional renamed fields. Class
355 Expression inherits from Exp as we must keep track if we must pop
356 the last value (this is for the comma operator), track the parent,
357 at Resolve we take care of the last value of the expression,
359 * VariableDeclaration.cs: updates needed because of EmitContext change.
361 * Statement.cs: added parent param to If constructor. Implement
362 Resolve and Emit for If statement.
364 * Relational.cs: Set parent. The boxing happens in the containing statement.
366 * FunctionDeclaration.cs: Added func_type field, will be used to determine the
367 type of the function we are generating (global function, method
368 from a class, etc) and attach to it the correct custom
369 attribute. Simplified the code for nested functions:
370 refactored the code so no code duplication is involved, now we
371 have only one function that retrieves the name of the function,
372 now create a new EmitContext for the body of the method.
374 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
375 current EmitContext's ILGenerator.
377 * Convert.cs: Do not throw the NotImplementedException anymore for
378 method ToBoolean, for now we always return false. This must get a
381 * CodeGenerator.cs: Deleted one of ILGenerator fields
382 from EmitContext, suffices using only one (more notes about the
383 change on the Functiondeclaration entry). Imitate jsc behavior for
384 compiled files names, aggregate the exe or dll extension after last dot.
386 * Block.cs: In order to implement the comma operator (i.e., expression,
387 assign_exp), we must track if our expressions are at a global
388 scope, in which case we must pop the last result too.
390 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
392 * Relational.cs: Initial generation of CIL for relational operators.
394 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
396 * jscript-lexer-parser.g: formal_param_list receives a parent too.
398 * SymbolTable.cs: added size and current_symbols properties.
400 * JSLocalField.cs: don't throw not ImplementedException from
401 constructor (same reason, testing purposes, must get implemented
404 * IdentificationTable.cs: added num_of_locals and current_locals properties.
406 * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
407 as fields. Not throw NotImplementedException for
408 JScriptFunctionDeclaration (testing purposes, must get implemeted
409 for real). Let's build our function closures! Added functions:
410 build_closure and build_closure_nested, build_local_fields. Keep
411 track of current parameters and locals defs.
413 * FormalParameterList.cs: made FormalParam inherit from
414 AST. Implement the Emit for parameters, yeah!
416 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
418 * Closure.cs: do not throw the exception (this allow me to run the
419 tests at mcs/jtests and check that at least i'm not generating
420 invalid CIL). Be aware that this must be really implemented.
422 * Block.cs: renamed field, and implement the double pass for
423 nested function declarations code emittion, yeah!.
425 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
427 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
428 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
429 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
430 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
431 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
433 * UnaryOp.cs: inherit from Exp now.
434 * Plus.cs: Don't throw the exception when calling constructor, let
435 it build the default handler. Return a new object when calling
436 EvaluatePlus until properly implemented.
438 * NumericUnary.cs: added new Resolve.
439 * NumericBinary.cs: assign operator val at ctr. Return a new
440 object when calling EvaluateNumericBinary until properly
441 implemented. Added Resolve.
442 * Equality.cs: added ctr and return false for EvaluateEquality
443 until properly implemented. Added Resolve's functions.
445 * Block.cs (Resolve): That check was not necessary.
447 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
448 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
449 BinaryOp and UnaryOp, and this from Exp.
450 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
451 * jscript-lexer-parser.g: deleted debugging messages. Create a
452 Assign object instance of a simple Binary obj. Same case for Equality.
454 * expression.cs: added Exp abstract class. Classes that are ast of
455 language constructions that can appear as global expressions that
456 get evaluated and then the result is discarded inherit from this
457 new class. This let meee keep track of things that must get Popped
458 or can even avoid the evaluation of it. Wrote real Resolve method
459 for classes: Unary, Binary.
460 Implemted Emit method for some binary operations (+, -, / and *),
461 for other operators some more code is still missing.
462 Identifier: handle assignment cases and global exp cases.
463 Added class Assign (compisite assignment still missing tough :-(
465 * driver.cs: deleted debug messages, added "Compilation Succeeded"
467 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
468 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
469 Exp and handle the case for global expressions that must be popped
470 after evaluation. no more invalid IL being generated! yeah!
471 * Block.cs: wrote real Resolve method, erased debug messages.
472 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
473 * BinaryOp.cs, Conditional: now inherits from Exp.
475 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
477 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
479 * CodeGenerator.cs: small fixes to generate same things that ms.
481 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
483 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
485 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
487 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
489 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
491 * jscript-lexer-parser.g: keep track of parent reference for
492 IDENTIFIER, STRING_LITERAL.
494 * expression.cs: Added 'binding' field. Added 'parent' parameter
495 to constructor. Now we emit the proper code for the identifier.
497 * VariableStatement.cs: updated to field names instead of the old
500 * VariableDeclaration.cs: Added class Decl, it constains the
501 references to the static field or LocalBuilder that are created
502 when a declaration is emitted. Deleted unuseful properties (Id,
505 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
506 object instead of a boolean.
508 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
510 * IdentificationTable.cs: Deleted Retrieve method. Contains method
511 now return an object instead of a boolean, that reference is the
512 binding associated with the identifier being searched.
514 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
516 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
518 * VariableDeclaration.cs: now I handle initialization (ex. var x =
519 2; or function f () { var x = 4; }) at global scope or at
522 * Literal.cs: Added parent param to NumericLiteral constructor.
524 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
526 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
528 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
530 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
532 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
533 "instanceof"; }' in order to be able to parse both keywords. When
534 generating the parser, one warning about nondeterminism
535 (k==1:"in") is generated ignore it.
537 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
539 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
540 not parsable now they are. Mozilla's and Janet's test suites are
541 being really helpful.
543 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
545 * jscript-lexer-parser.g: added check for non-null reference at
546 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
547 and multiple lines comments rule.
549 * jscript-lexer-parser.g: Now I keep track of the parent for most
550 of the syntatic constructs. Fixed object_literal rule.
552 * ast.cs: Added field parent. This will help me to track nested
553 blocks for all of the syntatic constructs and will allow to Emit
554 everything in one single pass.
555 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
557 * Block.cs, FunctionObject.cs: deleted parent field as AST will
558 hold it. Delete parent parameter from constructor.
559 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
560 EmitContext class. The idea is Emitting everything in one pass (decls
561 and 'Global Code' method, the parent reference let me know which IL
562 generator use, gc_ig or ig).
563 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
564 constructor. Use new parent reference for choosing the IL
565 generator. NumericLiteral a 'hard coded' int32 IL emittion added
567 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
568 the parent reference to infere which IL generator to use.
569 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
570 reference to infer which IL generator to use.
571 * expression.cs: Added paramenter parent to constructor of: Unary,
572 Binary, Conditional, Call.
574 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
576 * expression.cs: Added new field to Call class, so it can handle more arguments.
578 * StringLiteral.cs (Emit) : Load the string value.
580 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
582 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
583 custom attribute. Build default 'JScript 0' constructor. Emit
584 default initial/final code of 'Global Code'. Create default
587 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
589 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
590 repeating hand written rule all around. Change "." for DOT, dumb
591 mistake by myself. Added rule new_expr. Now we handle properly the
592 call_expr rule (as defined on the spec), and added a new
593 argument. Added subrule new_expr to left_hand_side_expr rule.
595 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
597 * expression.cs (Expression): implemented Emit.
599 * expression.cs (Binary): Emit now creates a local for the
600 different kinds of binary expressions (initial code for this).
602 * ast.cs: Emit method now is abstract instead of virtual.
604 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
606 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
607 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
608 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
609 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
610 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
611 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
612 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
613 Conditional, Call, Identifier, Args, Expression, :
616 * FunctionDeclaration.cs: Check if values are not null first (at
617 Resolve). Ignore code generation is at 'Global Code'.
619 * VariableDeclaration.cs: Now I take care of IL generation when we
620 are at statements and expressions at global code, 'Global Code'
621 method is populated with that IL.
623 * CodeGenerator.cs: Added flag for 'Global Code' method
624 emittion. Now I call 'Emit' twice. The first for declarations the
625 follower for statements and expressions at global scope.
627 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
629 * Visitor.cs: Deleted.
631 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
633 * FormalParameterList.cs: Now inherits from AST. Each of the
634 formal parameters gets into the IdentificationTable at Resolve.
636 * FunctionDeclaration.cs:Resolve (), We open a new block when
637 encountering a FunctionDeclaration, resolve de parameters and the
638 body, at the end we close the block.
640 * IdentificationTable.cs: Now we keep track of parent of the
641 current block. 'Enter (...)' now receives an object, not a
642 VarDecl. 'Contains' now take care of searching through the binding
645 * Literal.cs: Deleted 'Literal' class, was being used for
646 nothing. All the classes the inherited from it, now do it from
647 AST. A 'literal' does resolve to true by default.
649 * Relational.cs: Resolve recursively left and right.
651 * SemanticAnalyser.cs: added flag for 'print statement'.
653 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
656 * driver.cs: Init the semantic analysis phase.
658 * expression.cs: 'Unary' class, resolves its operand
659 first. 'Binary' class,resolves left and right first. 'Args' class
660 resolve all the formal parameters first. 'Expression' resolve all
661 the nested expressions first.
663 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
665 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
667 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
668 this is temporal in order to get Factorial compiled by mjs (must
669 build the types according to Ecma-262 spec).
671 * Literal.cs: Added NumericLiteral class.
673 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
675 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
676 if inside a nested block.
678 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
680 * jscript-lexer-parser.g: Now we take care of parents. This allows
681 to keep track if we are inside nested blocks. At
682 'func_decl_or_expr', now I built the FunctionDeclaration or
683 FunctionExpression first and then assign its body to it - this let
684 me get a non-null value of the FunctionExpression or
685 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
687 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
688 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
689 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
691 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
693 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
694 (gets the name of a function if it's nested). Emit code for
695 function's body. At 'Emit ()' now we take care if it's a nested
698 * FunctionObject.cs: default return type is 'void' not
699 'Object'. Function declarations without parameters map to functions with
700 'Object this' and 'VsaEngine engine' as parameters by
701 default. Assign parent to nested block.
703 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
704 a global declaration or inside a function declaration.
706 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
708 * FunctionObject.cs: Handle no parameters on functions.
710 * jscript-lexer-parser.g: Allow functions without parameters.
712 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
714 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
715 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
716 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
717 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
718 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
719 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
720 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
721 With.cs, expression.cs : Added
722 'Resolve' method stub.
724 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
726 * FormalParameterList.cs: Added FormalParam class. Change Add
727 method to receive the id and the type annotation from function's parameters.
729 * FunctionDeclaration.cs: Added code for initial function's
730 definition code generation.
732 * FunctionObject.cs: Added MethodAttributes and type_annot
733 fields. Added params_types function, which returns an array of
734 types from each of the function's parameters.
736 * IdentificationTable.cs: Added ToString method.
738 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
739 and add it again with the correct name). Not based on the Visitor
740 pattern anymore. Deleted all the VisitFOO methods. Added a
741 IdentificationTable field. Added Run, Dump methods.
743 * Statement.cs: Deleted Statement class (it was being used for
744 nothing). All classes that were having Statement as parent,
745 changed their parent to be AST.
747 * SymbolTable.cs: Added Add method that receives the id and the
748 declaration class. Retrieve changed to return an AST. Added
749 ToString method. Added 'SymbolTable parent' field.
751 * VariableDeclaration.cs: Added InitValue property.
753 * ast.cs: Added some comments and abstract method 'Resolve'.
755 * jscript-lexer-parser.g: Added parsing support for formal
756 parameters type annotations.
758 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
760 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
763 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
765 * jscript-lexer-parser.g: allow empty program files. Added type
766 annotations on var decl and function decl.
767 * VariableDeclaration.cs: added return type annotation field.
768 * FunctionExpression.cs: added return type parameter to constructor.
769 * FunctionDeclaration.cs: added return type parameter to
770 constructor. Added Emit method (just creates the static field at
771 the global object, for now).
772 * FunctionObject.cs: added return type to constructor. Changed
773 names to readable ones ;-)
775 * ScriptStream.cs: added WriteLine.
777 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
779 * ast.cs: Added 'virtual' Emit method (I might change it to be
780 abstract, but I would have to added to all classes that derive
781 from it. I'll do it later)
782 * Block.cs: Added Emit method.
783 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
784 anymore) - still missing some methods, ut on the way. A nice
785 hacking weekend coming. Added EmitContext class.
786 * ScriptBlock.cs: Added Emit method.
787 * VariableDeclaration.cs: Changed type field from string to
788 Type. Added Emit method.
789 * VariableStatement.cs: Added Emit method.
790 * driver.cs: Added CodeGeneration phase (only simple var
791 declarations support it. More coming soon).
794 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
796 * statement.cs: added Return class.
798 * Throw.cs: Added expression field, constructor and ToString.
800 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
803 * With.cs: added constructor and ToString. Back to the non-tmp
806 * jscript-parser-lexer.g: allow with_stm tree building.
808 * jscript-lexer-parser.g: changed the return type from if_stm from
809 'If' to AST. Added tree for continue_stm. Allowed building of
812 * statement.cs: switched to internal 'If' class. Added Continue
813 class. Added Break class.
815 * jscript-lexer-parser.g: build tree for function decl or expr.
817 * FunctionDeclaration.cs: added internal constructor.
819 * FunctionExpression.cs: added internal constructor.
821 * FunctionObject.cs: added internal constructor and ToString method.
823 * jscript-lexer-parser.g: added building tree for if_stm.
824 * Statement.cs: Added if class for 'if' statement.
827 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
829 * VariableDeclaration.cs: added the initializer to ToString.
831 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
834 * Block.cs, Equality.cs, Relational.cs: modified ToString
836 * Equality.cs, Relational.cs, StringLiteral.cs,
837 VariableDeclaration.cs: Added constructor
839 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
840 name convetion style to mono style.
842 * UnaryOp.cs: added operator and operand fields.
844 * VariableDeclaration.cs: chenged field name from assignExp to val.
846 * BinaryOp.cs: Made "internal" the attributes, added the two
849 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
851 * driver.cs: Dump the string representation of the parsed exps.
853 * Literal.cs: added BooleanLiteral
855 * Relational.cs: added constructor, ToString,
857 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
859 * README: added some info about hacking the grammar
861 * JSparser.cs: Updated the constructor to not receiving params.
863 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
864 JScriptParserTokenTypes.txt: update of antlr generated files from
867 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
868 can parse a little bit more useful programs like:
870 function factorial (i)
877 k = factorial (i - 1);
886 As you can see, it's not the classic factorial function
887 definition, I still have to make some tricks like storing the
888 result from the recursive call and then multiply. But this new
889 grammar it's easier to alter than the old one. Also we got support
890 for for-in statements, for statements, global expressions, support
891 for object accesors or better known as the "dot" operator. Two
892 rules are on the eye: left_hand_size_expr and call_expr, in order
893 to finish the parsing grammar and fix the bugs.
896 2003-09-29 <cesar@ciencias.unam.mx>
898 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
900 * Added VsaItem.cs, implements IVsaItem.
902 2003-09-28 <cesar@ciencias.unam.mx>
904 * VsaItems.cs: Check that no name is repeated (this was docs fault
905 :-)). This is the beauty of testing.
907 * Add VsaItems.cs, implements IVsaItems.
909 2003-09-22 <cesar@ciencias.unam.mx>
911 * DocumentContext.cs: changed constructor from internal to public,
912 this a kind of hack ;), but we can build mjs.exe with that change.
914 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
915 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
916 StringLiteral.cs, StringConstructor.cs, Statement.cs,
917 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
918 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
919 Package.cs, ObjectConstructor.cs, NumberObject.cs,
920 NumberConstructor.cs, MathObject.cs, Literal.cs,
921 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
922 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
923 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
924 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
925 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
926 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
927 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
928 ErrorConstructor.cs, EnumeratorObject.cs,
929 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
930 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
931 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
932 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
933 ActiveXObjectConstructor.cs, ActivationObject.cs:
935 indentation comformance to mono style. Returned to
936 Microsoft.JScript namespace name. Now we can build
937 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
938 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
939 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
940 about the namespace stuff, because I want people
941 to contribute NUnit tests for Microsoft.JScript public API.
943 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
945 2003-09-21 <cesar@ciencias.unam.mx>
947 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
949 2003-09-20 <cesar@ciencias.unam.mx>
951 * jscript-lexer-parser.g: We are little bit closer to the spec on
952 StringLiteral definition.
954 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
956 * jscript-lexer-parser.g: Build ast for FunctionExpression.
958 * JSObject.cs: we don't throw NotImplementedException anymore,
959 this let us use FunctionExpression to build the ast.
961 * FunctionExpression.cs: Added a FunctionObject as field, a
964 * FunctionObject.cs: Added default constructor.
966 * driver.cs: Deleted the Jsc class. We are not generating code
967 now. I'm moving to provide something like mcs's EmitContext
968 instead of the CodeGenerator class having the Reflection.Emit
969 builders and ILGenerator. This driver is just for Lexical and
970 Parsing phases testing.
972 * driver.cs: Now we are using the Microsoft.JScript public API
973 functions to load the lexer and parser.
975 * ScriptBlock.cs,Block.cs: Added ToString function.
977 2003-09-20 <cesar@ciencias.unam.mx>
979 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
980 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
981 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
982 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
983 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
984 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
985 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
986 : erased Visit method and made some mono indentation style changes.
988 * CodeGenerator.cs: commented some function calls.
989 * FunctionDeclaration.cs: moved function attributes to
990 FunctionObject class, erased Visit method.
991 * FunctionObject.cs: Here is where we store a function
992 expression/declaration info, erased Visit method.
993 * ScriptBlock.cs: Added a Block field, Block will contain the
995 * jscript-lexer-parser.g: updated the grammar to build the program
996 representation based on ScriptBlock.
998 2003-09-19 <cesar@ciencias.unam.mx>
1000 * JSToken.cs: public API compliance.
1002 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1004 * Context.cs: Added constructor and Document field.
1005 * DocumentContext.cs: Added Name field.
1006 * JSParser.cs: Integration of antlr's generated parser with
1007 JSParser public API. ScriptBlock is now the principal data structure that
1008 represents a Jscript .Net program.
1009 * JSScanner.cs: Integration of antlr's generated lexer with
1010 JSScanner public API.
1012 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1013 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
1015 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1017 * jscript-lexer-parser.g: Changed the namespace to
1018 Microsoft.JScript.Tmp.
1020 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
1022 * jscript-lexer-parser.g: Got the name of a
1023 global_function_declaration and also its return type if
1026 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
1027 * jscript-lexer-parser.g: Initial construction of AST for
1028 enum_statement and package_statement.
1030 * jscript-lexer-parser.g: Fixed the enum_statement to accept
1031 empty enum declarations.
1033 * jscript-lexer-parser.g: Got the type of a
1034 veriable_declaration.
1036 * jscript-lexer-parser.g: Initial construction of AST for
1037 primary_expression (in particular literal).
1040 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1042 * driver.cs: Modified the driver structure to be compatible
1043 with our new CodeGenrator and SemanticAnalizer. I
1044 removed the builders from Reflection.Emit to the
1045 CodeGenerator. Added an ASTList, SemanticAnalizer and
1046 CodeGenerator here. Adde methods Run, GenerateCode
1049 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1050 * Statement.cs: Forgot to include it on last commit.
1052 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1054 * Decided to change temporarly namespace name
1055 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
1056 to run the code generated by our CIL code generator (on next
1057 commit will come). The problem is that we don't have the
1058 runtime support for our compiler, this involve VsaEngine class
1059 and its "friends", which I have not found a lot of
1060 doumentation for. If someone knows a docs place for them,
1061 don't hesitate to send me a email pointing to them.
1063 * Changed from public to internal Visit function at some
1066 * Package.cs: Added Name and Members fields.
1068 * SemanticAnalizer.cs: Added methods VisitPrint and
1071 * VariableDeclaration.cs: Added Type field.
1073 * Visitor.cs: Changed from public to internal. Added
1074 VisitPrint and VisitStringLiteral methods.
1076 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
1077 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
1082 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1084 * Added CmdLineError.cs and JSError.cs, last night I forgot to
1087 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1089 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
1090 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
1091 CmdLineException.cs, CmdLineOptionParser.cs,
1092 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
1093 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
1094 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
1095 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
1096 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
1097 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
1098 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
1099 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
1100 LenientDateConstructor.cs, LenientDatePrototype.cs,
1101 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
1102 LenientFunctionPrototype.cs, LenientMathObject.cs,
1103 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
1104 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
1105 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
1106 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
1107 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
1108 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
1109 PostOrPrefixOperator.cs, RangeErrorObject.cs,
1110 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
1111 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
1112 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
1113 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
1114 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
1115 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
1116 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
1117 VersionableAttribute.cs
1119 Now, I must fill in the blanks :-)
1122 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1123 * jscript-lexer-parser.g: Added conditional_compilation_directive,
1124 which is the beginning of our support for conditional compilation
1125 statements and directives in our parser. Added
1126 cc_on_statement, and some lexer rules for getting the needed
1127 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
1128 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
1131 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1133 * jscript-lexer-parser.g: Changed the format of copyright notice.
1135 This changes will allow the support
1136 for the grammar added by MS to EcmaScript (aka its JScript .Net),
1137 I'm still missing some, but they are on the way.
1139 * jscript-lexer-parser.g: Deleted function_declaration, and
1140 added global_function_declaration and type_function_declaration.
1141 I decided to make the grammar as strict as the MS docs mark,
1142 but there's a difference between what their docs says and what
1143 their compiler does. For this case I decided to follow the
1144 docs. A program like:
1145 private function F ()
1147 according to the docs, would not be syntaticly correct. But the MS
1148 compiler, accepts the grammar construct and mark the error at
1149 semantic analysis phase. I followed the docs this time.
1151 * jscript-lexer-parser.g: Added debbuger_statement.
1152 * jscript-lexer-parser.g: Added import_statement.
1153 * jscript-lexer-parser.g: Added package_statement and package_member(s).
1154 * jscript-lexer-parser.g: Added super_statement.
1155 * jscript-lexer-parser.g: Added const_statement.
1156 * jscript-lexer-parser.g: Added class_statement,
1157 interfaces_list and class_members.
1159 * jscript-lexer-parser.g: Added interface_statement and
1162 * jscript-lexer-parser.g: Added enum_statement.
1163 * jscript-lexer-parser.g: Added static_statement. The rule for
1164 this syntatic construc is: static identifier { [body] }
1165 body does not get well specified in the docs. Must search wich
1166 are the possible values of it.
1168 * jscript-lexer-parser.g: At variable_declaration, added
1169 support for explicit type declaration.
1171 * jscript-lexer-parser.g: Added numeric_literal,
1172 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1174 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1177 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1180 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1181 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1182 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
1185 That method will be the driver that will allow classes
1186 that implement the Visitor interface do a walk through the AST's
1187 elements, in particular the Semantic Analizer and the Code
1188 Generator. Every class that inherits from AST will have a Visit
1189 method, that method will receive a Visitor and a object as
1190 parameters, the only thing that it'll do is letting the Visitor
1191 call the respective method VisitX, where X is the name of the
1192 currently visited class.
1194 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
1196 * FunctionDeclaration.cs: Added constructor, Visit and ToString
1199 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
1200 program (the main entry of the parser). Also added as parameters:
1201 - An AST to source_element.
1202 - A Statement to statement.
1203 - A VariableStatement to variable_statement.
1204 - A VariableStatement to variable_declaration_list.
1205 - A FormalParamerList by formal_parameter_list.
1206 - A ASTList by function_body.
1208 And now some rules return objects:
1209 - A VariableDeclaration by variable_declaration.
1210 - A Functiondeclaration by function_declaration.
1212 * driver.cs: Added the construction of the AST of the EcmaScript
1215 * Visitor.cs: Added this file. It's the visitor interface.
1217 * VariableDeclaration.cs: Added this class, it's the AST
1218 representation of a variable declaration.
1220 * Statement.cs: Added this file. It's the logical representation
1223 * VariableStatement.cs: Added this class. It's the AST
1224 representation of a chain of variable declarations.
1226 * FormalParameterList.cs: The function declaration needs to store
1227 its parameter, we will put them on this class.
1229 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
1230 implement the semantic analysis and code generation
1231 phases. SemanticAnalizer and CodeGenerator will implement the
1232 Visitor interface, they will walk a program's
1233 AST tree and do their respective work.
1235 * IdentificationTable.cs: Added this class. The SymbolTable will be used
1236 by the SemanticAnalyzer in order to keep track of the variable
1237 declaration encountered, etc..
1239 * SymbolTable.cs: A simple hashtable but for commodity i'll call
1243 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1245 * jscript-lexer-parser.g:
1246 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
1247 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
1248 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
1249 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
1250 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
1251 - Changed INTERROGATION to CONDITIONAL.
1252 - Changed TRIANGLE to BITWISE_XOR.
1253 - Changed SLASH to DIVISION.
1254 - Changed PERCENT to REMAINDER.
1255 - Changed ADMIRATION to LOGICAL_NOT
1256 - Added BITWISE_NOT (~).
1257 - Added the INCREMENT and DECREMENT rules for
1258 left_hand_side_expression.
1259 - Increased lexer lookup from 2 to 4.
1260 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
1261 BITWISE_AND, BITWISE_OR,
1262 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
1263 REMAINDER, UNSIGNED_RIGHT_SHIFT.
1264 - Added the recursion rules for equality_expression.
1265 - Added the recursion rules for shift_expression.
1267 - The most important thing, added support for expressions like:
1270 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1273 - Erased the Context class, it was used for the first
1274 test of the print_statement and Reflection.Emit. As I erased the
1275 Program, SourceElements, SourceElement from the ANTLR grammar (for
1276 the rework of the AST tied to the MS JScript public API), I erased
1278 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1279 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1280 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1283 * jscript-lexer-parser.g:
1284 - Erased the references to the classes Program, SourceElements,
1285 SourceElement, Statement, FunctionDeclaration and erased
1286 print_statement rule.
1288 * JSCriptLexer.cs JScriptParser.cs and the other files generated
1289 by antlr, reflect changes from the grammar changes.
1291 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1292 * Added stubs for the classes:
1295 ActiveXObjectConstructor.cs
1299 AssemblyCustomAttributeList.cs
1304 BooleanConstructor.cs
1312 EnumeratorConstructor.cs
1318 FunctionConstructor.cs
1319 FunctionDeclaration.cs
1320 FunctionExpression.cs
1324 IActivationObject.cs
1330 JSFunctionAttribute.cs
1331 JSFunctionAttributeEnum.cs
1336 LenientGlobalObject.cs
1338 NumberConstructor.cs
1340 ObjectConstructor.cs
1342 RegExpConstructor.cs
1347 StringConstructor.cs
1352 VBArrayConstructor.cs
1357 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1359 * jscript-lexer-parser.g:
1360 - Added rules for: continue_statement, break_statement,
1361 return_statement, throw statement (all of them do not ensure that
1362 no LineSeparator appears between the keyword on the left and the
1363 identifier, expression or semicolon on the right, that must be fixed).
1364 - Added single line comments rule.
1366 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1368 * jscript-lexer-parser.g: Added syntatic rule for:
1370 - while and for-in subrules of iteration_statement.
1371 - Added array_literal - got tricky - I just could get the simplest rule going :)
1375 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1377 * jscript-lexer-parser.g:
1378 - Syntatic rule for iteration_statement.
1379 - "do" subrule for it.
1380 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
1381 "in") relational_expression | ) rule to relational_expression.
1382 -Added function_expression syntatic rule.
1383 - Added STRING_LITERAL to literal rules.
1384 - "Less/Greater or equal than" lexer rule.
1386 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1388 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
1390 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1392 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1395 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1397 * Added a README file. Explains the dependencies and build process.
1399 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1401 * Added this ChangeLog file.
1403 * ast.cs: Added this file. Contains the classes used for building
1404 the EcmaScript 's AST.
1406 * JScript*: These are the files generated by antlr (the parser generator).
1408 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
1410 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
1411 that will be moved to other file in the future.
1413 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.