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