2004-10-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
[mono.git] / mcs / class / Microsoft.JScript / Microsoft.JScript / ChangeLog
1 2004-10-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
2
3         * StringObject.cs: add value field
4
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
9
10 2004-10-20  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
11
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
17
18 2004-10-19  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
19
20         * Parser.cs: set the operator properly.
21
22 2004-10-11  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
23
24         * GlobalObject.cs: ported encodeURI, encodeURIComponent,
25         decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode.
26         
27         * expression.cs (Call.Emit): implement IsConstructorProperty.
28
29 2004-10-06  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
30
31         * expression.cs: added support for function calls. Handle case of
32         print where no args are supplied.       
33
34 2004-10-05  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
35
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.
43
44 2004-09-22  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
45
46         * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField.
47
48         * Parser.cs: use ToJSToken to set the operator properly.
49         * FunctionDeclaration.cs: delete spaces.
50
51 2004-09-21  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
52
53         * FunctionDeclaration.cs: check for parent being a ScriptBlock.
54
55 2004-09-20  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
56
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.
83
84 2004-08-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
85
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.
95
96 2004-08-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
97
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
103         parent relationship.
104         * LateBinding.cs: back to Microsoft.JScript namespace.
105         
106
107 2004-08-23  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
108
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.
114
115 2004-08-21  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
116
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
141         Call's ast.
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.
163         
164 2004-07-29  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
165
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.
169
170 2004-07-19  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
171
172         * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
173         Mozilla/Rhino's  parser.
174
175 2004-06-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
176
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).
189
190 2004-06-20  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
191
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.
205         
206 2004-05-28  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
207
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.
213
214 2004-05-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
215
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.
219
220 2004-05-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
221
222         * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
223
224         * Statement.cs: Added code generation support for 'switch' statement.
225
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
229         inside_for ast. 
230
231         * With.cs: code generation support for 'with' stm.
232
233 2004-05-21  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
234
235         * Statement.cs: initial code generation of 'for'.
236         * jscript-lexer-parser.g: let's build for's ast.
237
238 2004-05-18  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
239
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.
245
246 2004-04-26  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
247
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.
251
252 2004-04-22  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
253
254         * Literal.cs: emit the correct code for negative numbers.
255         * jscript-lexer-parser.g: set parent unary_expr.
256
257 2004-04-18  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
258
259         * expression.cs: added code generation for 'x1 ? x2 :x3' op.
260         * Statement.cs: Added code generation for while and do-while.
261
262 2004-04-17  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
263
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.
269
270 2004-04-14  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
271
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
276         flow conditions. 
277
278 2004-04-02  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
279
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.
285
286 2004-03-31  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
287
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.
293
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.
297
298         * FunctionDeclaration.cs: agrouped code for setting custom attribute.
299
300         * expression.cs: added Modulo operator case.
301
302 2004-03-16  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
303
304         * Convert.cs: added rule for string conversion.
305
306         * Plus.cs: added rule for string addition.
307
308         * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
309         Emit (cases where there's no real operator).
310
311         * StringLiteral.cs: now implements Exp as can appear as a simple
312         exp in global code. Added check for Pop generation.
313
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.
319
320         * jscript-lexer-parser.g: postfix_expr rule now returns a simple
321         AST, this handles the case where no postOrPrefixOp present; Unary
322         returns an AST too.
323
324         * FormalParameterList.cs: added get_element, retrieves nth element.
325
326 2004-03-14  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
327
328         * ScriptStream.cs: let's print some messages.
329
330         * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
331
332 2004-03-13  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
333
334         * jscript-lexer-parser.g: keep track of return's parent.
335         * Statement.cs: added parent parameter to constructor.
336
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.
340         
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.
344         
345         * FormalParameterList.cs: added field pos to FormalParam, and set
346         it at FormalParameterList's Resolve stage. 
347         
348         * TODO: updated TODO.
349
350 2004-03-07  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
351
352         * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
353
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, 
358
359         * VariableDeclaration.cs: updates needed because of EmitContext change.
360
361         * Statement.cs: added parent param to If constructor. Implement
362         Resolve and Emit for If statement.
363
364         * Relational.cs: Set parent. The boxing happens in the containing statement.
365
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.
373
374         * FormalParameterList.cs, Literal.cs, StringLiteral.cs:  use
375         current EmitContext's ILGenerator. 
376
377         * Convert.cs: Do not throw the NotImplementedException anymore for
378         method ToBoolean, for now we always return false. This must get a
379         real implementation.
380
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.
385
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.
389
390 2004-01-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
391
392         * Relational.cs: Initial generation of CIL for relational operators.
393
394 2004-01-23  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
395
396         * jscript-lexer-parser.g: formal_param_list receives a parent too.
397
398         * SymbolTable.cs: added size and current_symbols properties.
399
400         * JSLocalField.cs: don't throw not ImplementedException from
401         constructor (same reason, testing purposes, must get implemented
402         for real).
403
404         * IdentificationTable.cs: added num_of_locals and current_locals properties.
405
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.
412
413         * FormalParameterList.cs: made FormalParam inherit from
414         AST. Implement the Emit for parameters, yeah!
415
416         * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.   
417
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.
421
422         * Block.cs: renamed field, and implement the double pass for
423         nested function declarations code emittion, yeah!.
424
425 2004-01-16  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
426
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.
432
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.
437
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.
444
445         * Block.cs (Resolve): That check was not necessary.
446         
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.
453
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 :-(
464
465         * driver.cs: deleted debug messages, added "Compilation Succeeded"
466         message ;-).
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.
474
475 2004-01-15  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
476
477         * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
478
479         * CodeGenerator.cs: small fixes to generate same things that ms.
480
481 2004-01-13  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
482
483         * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
484
485 2004-01-12  Atsushi Enomoto  <atsushi@ximian.com>
486
487         * JSMethodInfo.cs : tiny fix for NET_2_0 build.
488
489 2003-12-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
490
491         * jscript-lexer-parser.g: keep track of parent reference for
492         IDENTIFIER, STRING_LITERAL.
493
494         * expression.cs: Added 'binding' field. Added 'parent' parameter
495         to constructor. Now we emit the proper code for the identifier.
496
497         * VariableStatement.cs: updated to field names instead of the old
498         property's name.
499
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,
503         InitValue, Type).
504
505         * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
506         object instead of a boolean.
507
508         * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
509
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.
513
514 2003-12-18  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
515
516         * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
517
518         * VariableDeclaration.cs: now I handle initialization (ex. var x =
519         2; or function f () { var x = 4; }) at global scope or at
520         function's body.
521
522         * Literal.cs: Added parent param to NumericLiteral constructor.
523
524         * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
525
526 2003-12-17  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
527
528         * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
529
530 2003-12-10  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
531
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.
536
537 2003-12-07  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
538
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.
542
543 2003-12-05  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
544
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.
548
549         * jscript-lexer-parser.g: Now I keep track of the parent for most
550         of the syntatic constructs. Fixed object_literal rule.
551
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
556         parent stuff.
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
566         for testing. 
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.
573
574 2003-11-30  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
575
576         * expression.cs: Added new field to Call class, so it can handle more arguments.
577
578         * StringLiteral.cs (Emit) : Load the string value.
579
580         * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
581
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
585         'JScript Main'.
586
587 2003-11-29  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
588
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.
594
595 2003-11-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
596
597         * expression.cs (Expression): implemented Emit.
598
599         * expression.cs (Binary): Emit now creates a local for the
600         different kinds of binary expressions (initial code for this).
601
602         * ast.cs: Emit method now is abstract instead of virtual.
603
604         * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
605
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, :
614         added Emit method.
615
616         * FunctionDeclaration.cs: Check if values are not null first (at
617         Resolve). Ignore code generation is at 'Global Code'.
618
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.  
622
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.
626         
627 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
628
629         * Visitor.cs: Deleted.
630
631 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
632
633         * FormalParameterList.cs: Now inherits from AST. Each of the
634         formal parameters gets into the IdentificationTable at Resolve.
635
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.
639
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
643         chain.
644
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.
648
649         * Relational.cs: Resolve recursively left and right.
650
651         * SemanticAnalyser.cs: added flag for 'print statement'.
652
653         * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
654         and false_stm.
655
656         * driver.cs:  Init the semantic analysis phase.
657
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.
662
663         * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
664         
665 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
666
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).
670
671         * Literal.cs: Added NumericLiteral class.
672
673 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
674
675         * FunctionDeclaration.cs: Build a ScriptFunction local variable,
676         if inside a nested block.
677
678 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
679
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!).
686
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.
690
691         * ScriptBlock.cs: Initiate the global block with 'null' as parent.
692         
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
696         declaration.
697
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.
702
703         * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
704         a global declaration or inside a function declaration.
705         
706 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
707
708         * FunctionObject.cs: Handle no parameters on functions.
709         
710         * jscript-lexer-parser.g: Allow functions without parameters.
711
712 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
713
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.
723
724         * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
725
726         * FormalParameterList.cs: Added FormalParam class. Change Add
727         method to receive the id and the type annotation from function's parameters.
728
729         * FunctionDeclaration.cs: Added code for initial function's
730         definition code generation.
731
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.
735
736         * IdentificationTable.cs: Added ToString method.
737
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.
742
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.
746
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.
750
751         * VariableDeclaration.cs: Added InitValue property.
752
753         * ast.cs: Added some comments and abstract method 'Resolve'.
754
755         * jscript-lexer-parser.g: Added parsing support for formal
756         parameters type annotations.
757         
758 2003-10-30  cesar lopez nataren <cesar@ciencias.unam.mx>
759
760         * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
761         thanks to Hector!) 
762
763 2003-10-28  cesar lopez nataren <cesar@ciencias.unam.mx>
764
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 ;-) 
774
775         * ScriptStream.cs: added WriteLine.
776
777 2003-10-24  cesar lopez nataren <cesar@ciencias.unam.mx>
778
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).
792
793
794 2003-10-22  cesar lopez nataren <cesar@ciencias.unam.mx>
795
796         * statement.cs: added Return class.
797
798         * Throw.cs: Added expression field, constructor and ToString.
799         
800         * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
801         building.  
802         
803         * With.cs: added constructor and ToString. Back to the non-tmp
804         namespace.
805
806         * jscript-parser-lexer.g: allow with_stm tree building.
807
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
810         Break tree.
811
812         * statement.cs: switched to internal 'If' class. Added Continue
813         class. Added Break class.
814         
815         * jscript-lexer-parser.g: build tree for function decl or expr.
816
817         * FunctionDeclaration.cs: added internal constructor.
818
819         * FunctionExpression.cs: added internal constructor.
820
821         * FunctionObject.cs: added internal constructor and ToString method.
822
823         * jscript-lexer-parser.g: added building tree for if_stm.
824         * Statement.cs: Added if class for 'if' statement.
825         
826
827 2003-10-21  cesar lopez nataren  <cesar@ciencias.unam.mx>
828
829         * VariableDeclaration.cs: added the initializer to ToString.
830         
831         * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
832         trees) building.
833         
834         * Block.cs, Equality.cs, Relational.cs: modified ToString 
835
836         * Equality.cs, Relational.cs, StringLiteral.cs,
837         VariableDeclaration.cs: Added constructor 
838
839         * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
840         name convetion style to mono style.
841
842         * UnaryOp.cs: added operator and operand fields.
843
844         * VariableDeclaration.cs: chenged field name from assignExp to val.
845
846         *  BinaryOp.cs: Made "internal" the attributes, added the two
847         operators holders.
848
849         * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
850         
851         * driver.cs: Dump the string representation of the parsed exps.
852
853         * Literal.cs:  added BooleanLiteral
854
855         * Relational.cs: added constructor, ToString, 
856
857 2003-10-10  cesar lopez nataren <cesar@ciencias.unam.mx>
858
859         * README: added some info about hacking the grammar
860
861         * JSparser.cs: Updated the constructor to not receiving params.
862
863         * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
864         JScriptParserTokenTypes.txt: update of antlr generated files from
865         grammar changes. 
866
867         * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
868         can parse a little bit more useful programs like:
869
870         function factorial (i)
871         {
872                 var k;
873
874                 if (i <= 0)
875                         return 1;
876                 else {
877                         k = factorial (i - 1);
878                         return i * k;
879                 }
880         }
881
882         var x;
883         x = factorial (4); 
884         print (x);
885
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.
894
895
896 2003-09-29    <cesar@ciencias.unam.mx>
897
898         * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
899
900         * Added VsaItem.cs, implements IVsaItem.
901
902 2003-09-28    <cesar@ciencias.unam.mx>
903
904         * VsaItems.cs: Check that no name is repeated (this was docs fault
905         :-)). This is the beauty of testing.
906
907         * Add VsaItems.cs, implements IVsaItems.
908
909 2003-09-22    <cesar@ciencias.unam.mx>
910
911         * DocumentContext.cs: changed constructor from internal to public,
912         this a kind of hack ;), but we can build mjs.exe with that change.
913
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: 
934
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.
942                 
943         * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
944
945 2003-09-21    <cesar@ciencias.unam.mx>
946
947         * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
948
949 2003-09-20    <cesar@ciencias.unam.mx>
950
951         * jscript-lexer-parser.g: We are little bit closer to the spec on
952         StringLiteral definition.  
953
954         * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
955
956         * jscript-lexer-parser.g: Build ast for FunctionExpression.
957
958         * JSObject.cs: we don't throw NotImplementedException anymore,
959         this let us use FunctionExpression to build the ast.
960
961         * FunctionExpression.cs: Added a FunctionObject as field, a
962         default constructor.
963
964         * FunctionObject.cs: Added default constructor.
965
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.
971
972         * driver.cs: Now we are using the Microsoft.JScript public API
973         functions to load the lexer and parser.
974
975         * ScriptBlock.cs,Block.cs: Added ToString function.
976
977 2003-09-20    <cesar@ciencias.unam.mx>
978
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.
987
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
994         source elements.
995         * jscript-lexer-parser.g: updated the grammar to build the program
996         representation based on ScriptBlock.
997
998 2003-09-19    <cesar@ciencias.unam.mx>
999
1000         * JSToken.cs: public API compliance.
1001
1002 2003-09-07 Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1003
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.
1011
1012 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1013         * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
1014
1015 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1016
1017         * jscript-lexer-parser.g: Changed the namespace to
1018         Microsoft.JScript.Tmp.
1019
1020         * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
1021
1022         * jscript-lexer-parser.g: Got the name of a
1023         global_function_declaration and also its return type if
1024         available. 
1025
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.
1029
1030         * jscript-lexer-parser.g: Fixed the enum_statement to accept
1031         empty enum declarations.
1032
1033         * jscript-lexer-parser.g: Got the type of a
1034         veriable_declaration.
1035
1036         * jscript-lexer-parser.g: Initial construction of AST for
1037         primary_expression (in particular literal).
1038
1039
1040 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1041
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
1047
1048
1049 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1050         * Statement.cs: Forgot to include it on last commit.
1051
1052 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1053         
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.
1062
1063         * Changed from public to internal Visit function at some
1064         classes.
1065
1066         * Package.cs: Added Name and Members fields.
1067         
1068         * SemanticAnalizer.cs: Added methods VisitPrint and
1069         VisitStringLiteral.
1070
1071         * VariableDeclaration.cs: Added Type field.
1072
1073         * Visitor.cs: Changed from public to internal. Added
1074         VisitPrint and VisitStringLiteral methods.
1075
1076         * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
1077         Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
1078         
1079
1080
1081
1082 2003-07-22  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1083
1084         * Added CmdLineError.cs and JSError.cs, last night I forgot to
1085         commit them.
1086
1087 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1088         * Added files:
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 
1118
1119         Now, I must fill in the blanks :-)
1120
1121
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.
1129
1130
1131 2003-07-03  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1132
1133         * jscript-lexer-parser.g: Changed the format of copyright notice.
1134
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.
1138
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 () 
1146                 {}
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. 
1150
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. 
1158
1159         * jscript-lexer-parser.g: Added interface_statement and
1160         interface_members.
1161
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.
1167
1168         * jscript-lexer-parser.g: At variable_declaration, added
1169         support for explicit type declaration.
1170
1171         * jscript-lexer-parser.g: Added numeric_literal,
1172         DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1173
1174         * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1175
1176
1177 2003-06-09  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1178
1179
1180         * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1181         Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1182         FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
1183         With, 
1184         
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.
1193         
1194         * ASTList.cs:Added constructor, Add, Visit, ToString  methods.
1195
1196         * FunctionDeclaration.cs: Added constructor, Visit and ToString
1197         methods.
1198         
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.
1207         
1208         And now some rules return objects:
1209                 - A VariableDeclaration by variable_declaration.
1210                 - A Functiondeclaration by function_declaration.
1211
1212         * driver.cs: Added the construction of the AST of the EcmaScript
1213         program.
1214
1215         * Visitor.cs: Added this file. It's the visitor interface. 
1216
1217         * VariableDeclaration.cs: Added this class, it's the AST
1218         representation of a variable declaration.
1219
1220         * Statement.cs: Added this file. It's the logical representation
1221         of a Statement.
1222
1223         * VariableStatement.cs: Added this class. It's the AST
1224         representation of a chain of variable declarations.
1225         
1226         * FormalParameterList.cs: The function declaration needs to store
1227         its parameter, we will put them on this class.
1228
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.
1234
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..
1238
1239         * SymbolTable.cs: A simple hashtable but for commodity i'll call
1240         it this way.
1241
1242         
1243 2003-05-03  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1244
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.
1266         - Now we skip tabs.
1267         - The most important thing, added support for expressions like:
1268         sdf.[hgh], cool!
1269
1270 2003-04-20      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1271
1272         * driver.cs: 
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
1277         some uses in here.
1278         - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1279         EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1280         EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1281         Emit.
1282
1283         * jscript-lexer-parser.g: 
1284         - Erased the references to the classes Program, SourceElements,
1285         SourceElement, Statement, FunctionDeclaration and erased
1286         print_statement rule. 
1287
1288         * JSCriptLexer.cs JScriptParser.cs and the other files generated
1289         by antlr, reflect changes from the grammar changes.
1290
1291 2003-04-19      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1292         * Added stubs for the classes:
1293         ASTList.cs 
1294         ActivationObject.cs 
1295         ActiveXObjectConstructor.cs 
1296         ArrayConstructor.cs 
1297         ArrayLiteral.cs 
1298         ArrayObject.cs 
1299         AssemblyCustomAttributeList.cs 
1300         BaseVsaEngine.cs 
1301         BinaryOp.cs 
1302         Binding.cs 
1303         Block.cs 
1304         BooleanConstructor.cs 
1305         BooleanObject.cs 
1306         Closure.cs 
1307         Context.cs 
1308         DateConstructor.cs 
1309         DateObject.cs 
1310         DebugBreak.cs 
1311         Empty.cs 
1312         EnumeratorConstructor.cs 
1313         EnumeratorObject.cs 
1314         ErrorConstructor.cs 
1315         ErrorObject.cs 
1316         Eval.cs 
1317         ForIn.cs 
1318         FunctionConstructor.cs 
1319         FunctionDeclaration.cs 
1320         FunctionExpression.cs 
1321         FunctionObject.cs 
1322         GlobalObject.cs 
1323         GlobalScope.cs 
1324         IActivationObject.cs 
1325         IRedirectOutput.cs 
1326         IVsaScriptScope.cs 
1327         Import.cs 
1328         JSBuiltIn.cs 
1329         JSField.cs 
1330         JSFunctionAttribute.cs 
1331         JSFunctionAttributeEnum.cs 
1332         JSLocalField.cs 
1333         JSObject.cs 
1334         JSToken.cs 
1335         JSVariableField.cs 
1336         LenientGlobalObject.cs 
1337         MathObject.cs 
1338         NumberConstructor.cs 
1339         NumberObject.cs 
1340         ObjectConstructor.cs 
1341         Package.cs 
1342         RegExpConstructor.cs 
1343         RegExpObject.cs 
1344         ScriptBlock.cs 
1345         ScriptFunction.cs 
1346         ScriptObject.cs 
1347         StringConstructor.cs 
1348         StringObject.cs 
1349         Throw.cs 
1350         Try.cs 
1351         UnaryOp.cs 
1352         VBArrayConstructor.cs 
1353         VsaEngine.cs 
1354         With.cs         
1355         
1356
1357 2003-04-11      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1358
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.
1365
1366 2003-04-08      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1367
1368         * jscript-lexer-parser.g: Added syntatic rule for:
1369         - if_statement.
1370         - while and for-in subrules of iteration_statement.
1371         - Added array_literal - got tricky - I just could get the simplest rule going :)
1372         - Added elision.
1373
1374         
1375 2003-04-08      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1376
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.
1385
1386 2003-04-03      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1387
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.
1389
1390 2003-04-01    Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1391
1392         * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1393         
1394
1395 2003-03-30    Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1396
1397         * Added a README file. Explains the dependencies and build process.
1398
1399 2003-03-30   Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1400
1401         * Added this ChangeLog file.
1402         
1403         * ast.cs: Added this file. Contains the classes used for building
1404         the EcmaScript 's AST.
1405
1406         * JScript*: These are the files generated by antlr (the parser generator). 
1407
1408         * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
1409
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.
1412
1413         * jscript-lexer-parser.g: The EcmaScript's antlr grammar.