2005-05-18 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / class / Microsoft.JScript / Microsoft.JScript / ChangeLog
1 2005-05-18  Marek Safar  <marek.safar@seznam.cz>
2 \r
3         * JScriptCodeGenerator.cs: Stubbed.\r
4         \r
5         * JScriptCodeProvider.cs: Implemented.\r
6 \r
7 2005-05-17  Cesar Lopez Nataren  <cnataren@novell.com>
8
9         * SemanticAnalizer.cs: Add methods_with_outter_scope_refs and
10         methods_with_vars_used_nested hashtables.
11         AddMethodReferenceOutterScopeVar,  AddMethodVarsUsedNested,
12         MethodReferenceOutterScopeVar. OutterScopeVar,
13         MethodVarsUsedNested and VarUsedNested.
14         * CodeGenerator.cs: Add locals_to_stack_frame method and emit_parents.
15         * TypeManager.cs: Add LocalsAtDepth.
16         * VariableDeclaration.cs: keep track of the lexical depth of
17         current declaration.
18         * FunctionDeclaration.cs: take care of outter scope variables uses.
19         * IdentificationTable.cs: keep track of Catch statement opened blocks.
20         * expression.cs: take care of eval's Net_1_0 and greater
21         versions. Implement the use of variables in nested scopes. For it,
22         we track the variable's scope level and we compare it with the
23         level in which appears if there's a difference supperior to one
24         and the variables wasn't not declared in the global scope we
25         proceed to generate the code that keep tracks of the state of the
26         variables through a StackFrame, in which we copy the local vars
27         prior to the invocation to the nested method which uses a outter
28         scope variable, then we copy back the variables in the StackFrame
29         into de local vars when the invocation finishes.
30         
31         * Try.cs: open a scope indicating that's for a catch block.
32
33 2005-05-07  Cesar Lopez Nataren  <cnataren@novell.com>
34
35         * MethodInvoker.cs, ScriptObject.cs, BitwiseBinary.cs,
36         ActivationObject.cs, PostOrPrefixOperator, StackFrame.cs,
37         NumericUnary.cs, JSConstructor.cs, Equality.cs, NumericBinary.cs,
38         Convert.cs, LateBinding.cs, Plus.cs, BitwiseBinary.cs,
39         JSMethodInfo.cs, Relational.cs, ScriptFunction.cs : Add missing
40         debugger attributes.
41
42 2005-05-06  Cesar Lopez Nataren  <cnataren@novell.com>
43
44         * Binding.cs: add missing methods and fields.
45
46 2005-05-03  Cesar Lopez Nataren  <cnataren@novell.com>
47
48         * ReturnOutOfFinally.cs, SyntaxErrorObject.cs, TypeReflector.cs,
49         JSPrototypeObject.cs, ReferenceErrorObject.cs, Namespace.cs,
50         expression.cs (Unary class), Binding.cs, ArrayWrapper.cs,
51         CmdLineOptionParser.cs, TypeErrorObject.cs, JSConstructor.cs,
52         TypedArray.cs, FunctionWrapper.cs, SuperTypeMembersSorter.cs,
53         ContinueOutOfFinally.cs, BlockScope.cs,
54         AssemblyCustomAttributeList.cs, VersionableAttribute.cs,
55         SimpleHashtable.cs, ResInfo.cs, Import.cs,
56         NotRecommendedAttribute.cs, CmdLineException.cs, DebugBreak.cs,
57         VBArrayObject.cs, CmdLineError.cs, TODOAttribute.cs,
58         RegExpMatch.cs, JScriptCodeProvider.cs, RangeErrorObject.cs,: Fixes for API compliance.
59
60 2005-04-28  Cesar Lopez Nataren  <cnataren@novell.com>
61
62         * BinaryOp.cs, ActivationObject.cs, expression.cs (Args),
63         ArrayLiteral.cs, ArrayObject.cs, IRedirectOutput.cs, ASTList.cs,
64         IVsaScriptScope.cs, ast.cs (AST), BinaryOp.cs,
65         EnumeratorObject.cs, BreakOutOfFinally.cs, Enum.cs,
66         FormalParameterList.cs, FunctionDeclaration.cs, Equality.cs,
67         Closure.cs, Block.cs, Statement.cs, BooleanObject.cs,
68         LenientBooleanPrototype.cs, GlobalObject.cs, BooleanPrototype.cs,
69         CodeGenerator.cs, LenientDateConstructor.cs,
70         LenientGlobalObject.cs, JSToken.cs, MethodInvoker.cs,
71         LenientRegExpPrototype.cs, NumericUnary.cs,
72         LenientArrayPrototype.cs, JSParser.cs, JSPropertyInfo.cs,
73         LenientVBArrayPrototype.cs, LenientStringPrototype.cs,
74         LenientObjectPrototype.cs, With.cs, ScriptBlock.cs, Expando.cs,
75         JSScanner.cs, LenientEnumeratorPrototype.cs, EvalErrorObject.cs,
76         VariableDeclaration.cs, Print.cs, LenientErrorPrototype.cs,
77         LenientBooleanPrototype.cs, LenientFunctionPrototype.cs, Literal.cs,
78         LenientMathObject.cs, LenientDatePrototype.cs,  Relational.cs,
79         Parser.cs, Throw.cs, VariableStatement.cs, RegExpObject.cs, Eval.cs,
80         SemanticAnalizer.cs, LenientStringConstructor.cs,
81         LenientNumberPrototype.cs, FieldAccessor.cs : Changes for MS API
82         compliance. 
83
84 2005-04-18  Cesar Lopez Nataren  <cnataren@novell.com>
85
86         * Parser.cs: Build a StrictEquality object instead of a Equality
87         object, when we have === and !=== as operator.
88         * CodeGenerator.cs: (ft_emit_equality, fall_true) Take into account the
89         strict cases of equality. 
90         * StrictEquality.cs: Add parent, left and right params to default
91         ctr. Implement Resolve and Emit.
92
93 2005-04-15  Cesar Lopez Nataren  <cnataren@novell.com>
94
95         * Statement.cs: make internal the builders.
96         * expression.cs: (Identifier.Emit) Take into account if its
97         binding is of type Catch.
98
99 2005-04-14  Cesar Lopez Nataren  <cnataren@novell.com>
100
101         * SemanticAnalizer.cs: Added a Hashtable that indicates which
102         methods need to generate proper code for handling the local vars
103         in the StackFrame. Added method AddMethodWithEval, MethodContainsEval.
104
105         * Eval.cs: Back to M.J.
106
107         * ast.cs: locals from abstract class Function is now an array of
108         objects not just AST's.
109
110         * CodeGenerator.cs: Clean up fall_true, better using recursion :)
111         Added static method load_local_vars. At method ft_emit_equality do
112         Emit the code of the ast. Added method load_local_vars.
113
114         * FunctionDeclaration.cs: Update call to TypeManager methods to
115         new API. Added a check for invocations to 'eval' inside functions
116         so StackFrame IL code gets generated. Build the function's closure
117         take the need for the StackFrame into account.
118         
119         * TypeManager.cs: renamed IdentificationTable locals to
120         local_script_functions, AddLocal to AddLocalScriptFunction,
121         GetLocal to GetLocalScriptFunction. Added method CurrentLocals.
122
123         * IdentificationTable.cs: Method CurrentLocals now returns
124         an array of object's not AST's.
125
126         * expression.cs: (class Call) Check if we have a call to 'eval',
127         if so we must keep up the StackFrame which contains the local
128         vars. We generate special code that handles the StackFrame with
129         the local vars in order to keep them in sync. When a function
130         contains an invocation to 'eval' even when such function is a
131         function declared in the code we do not perform a direct method
132         call to it when invoked instead a call through late binding gets
133         performed. Added methods IsEval, set_local_vars. Implement 'eval'
134         from JScript!
135
136 2005-04-10  Cesar Lopez Nataren  <cnataren@novell.com>
137
138         * StackTrace.cs: Back to M.J namespace.
139
140 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
141
142         * Literal.cs: fix the build and broke something else ;-).
143
144 2005-04-08  Cesar Lopez Nataren  <cnataren@novell.com>
145
146         * Literal.cs: Implement the construction of regular expression literal.
147         * Parser.cs: Pass the proper parent to RegExpLiteral.
148
149 2005-03-30  Cesar Lopez Nataren  <cnataren@novell.com>
150
151         * TypeOf.cs: take into account Objects.
152         * ArrayConstructor.cs: Implement CreateInstance.
153         * LateBinding.cs: Initial implementatio of CallValue and
154         SetIndexedPropertyValueStatic.
155         * JSFieldInfo.cs: Implement GetValue and SetValue.
156         * ArrayObject.cs: Implement length, add three ctrs.
157         * JScriptException.cs: Add error_number field. Implement
158         ctr. ErrorNumber, Message and StackTrace.
159         * ArrayPrototype.cs: Implement join and toString.       
160         * JSObject.cs: Remove the ChainHash, we use a simple hashtable
161         now, the one inherited from ScriptObject.
162         * ScriptObject.cs: Add a Hashtable here.
163
164 2005-03-29  Cesar Lopez Nataren  <cnataren@novell.com>
165
166         * GlobalScope.cs: Set parent and engine in ctr. Return 'this' for
167         GetDefaultThisObject.
168         * ScriptObject.cs: Added protected 'parent' field of type
169         GlobalScope.
170
171 2005-03-16  Cesar Lopez Nataren  <cnataren@novell.com>
172
173         * FunctionExpression.cs: Update to TypeManager new API.
174
175         * TypeManager.cs: Keep both MethodBuilder and LocalBuilder around.
176
177         * FunctionDeclaration.cs: In some contexts we need the
178         MethodBuilder and LocalBuilder, so we must keep both around.
179
180         * expression.cs: (load_script_func) Take care if bounded variable
181         was declared in a nested context. (emit_create_instance) Handle
182         the FunctionConstructor case.
183
184 2005-02-28  Cesar Lopez Nataren  <cnataren@novell.com>
185
186         * ForIn.cs: Initial implementation of ForIn stm.
187
188 2005-02-27  Cesar Lopez Nataren  <cnataren@novell.com>
189
190         * VariableStatement.cs (PopulateContext): Do not add the symbol to
191         the context if already defined in current context.
192
193         * CodeGenerator.cs: Renamed VariableDefined to variable_defined_in_current_scope.
194
195         * TypeManager.cs: Reimplemented it, We use an IdentificationTable
196         instead of a simple Hashtable so we can handle scopes
197         properly. Cleaner api.
198
199         * VariableDeclaration.cs: Use new CodeGenerator api. (EmitDecl)
200         Add the builders to the TypeManager.
201
202         * Block.cs: Use new TypeManager api.
203
204         * FunctionDeclaration.cs: Use new TypeManager api. Take care of
205         scopes in the TypeManger on Emit.
206
207         * IdentificationTable.cs: (Binder) Changed the type of value from
208         AST to object so I can use this symbol table
209         anywhere. (IdentificationTable) Add current_locals stack and added
210         method InCurrentScope. 
211
212         * expression.cs: Use new api from TypeManager, Add casts where neeeded.
213
214         This solves an infinite loop we were falling into when calling
215         IdentificationTable.CurrentLocals when repeated declarations where
216         inside function declarations.
217         
218         * ast.cs: Added protected field ig to class Function.
219         * Block.cs: Emit function's body in a later phase since free
220         ocurrences of functions - at the same level of it - can be handled
221         properly, since they must be defined and inited to the correct values.
222         * FunctionDeclaration.cs: Renamed Emit to create_closure. And make
223         Emit only generate the code of the body.
224
225         Fixes #73078.
226
227 2005-02-22  Cesar Lopez Nataren  <cnataren@novell.com>
228
229         * Block.cs: Report error JS5040. Reopened #72674, see last comment of it.
230
231         * CodeGenerator.cs: Added method VariableDefined.
232         
233         * TypeManager.cs: Added method SetMethod.
234         
235         * VariableDeclaration.cs (EmitDecl): Added logic to allow multiple
236         declarations of the same var. Fixes #72674.
237         
238         * Block.cs: Added hashtable ocurrences. It holds the index of the
239         previous declaration which after encountering another one with the
240         same name gets nuked.
241
242         * FunctionDeclaration.cs: Added logic for allowing multiple
243         declaration of methods with the same name. Fixes #72674.        
244
245         * expression.cs (Args): Added field func. Holds a reference to the
246         Function which to the args are being passed. Use it to track the
247         proper number of arguments for the call. 
248
249 2005-02-20  Cesar Lopez Nataren  <cnataren@novell.com>
250
251         * expression.cs (Args.Emit): check if num_of_args is -1.
252         * ast.cs (Function.NumOfArgs): avoid using a null pointer. In the
253         code generation phase if num_of_args is -1 means the actual
254         arguments are the desired number of args. Fixes #72697.
255
256         * Parser.cs: Pass proper parent.
257         * CodeGenerator.cs: added emit_get_default_this.
258         * Literal.cs (This) : Resolve and Emit implemented. Fixes #72477
259         * expression.cs: (emit_late_get_or_set) use
260         load_engine. (load_script_func) Ensure that TypeManager has a ref
261         to the local otherwise it's a field. (New.Resolve) Check if late
262         binding is needed. (New.Emit) Generate proper IL that make use of
263         late binding  when the id of the constructor it's not part of the
264         build in objects.
265
266 2005-02-14  Cesar Lopez Nataren  <cnataren@novell.com>
267
268         * Token.cs, TokenStream.cs, Parser.cs: make this classes internal.
269
270         * Context.cs: delete wrongly exposed ctr.
271
272 2005-02-10  Cesar Lopez Nataren  <cnataren@novell.com>
273
274         * expression.cs: use InFuntion in proper places.
275
276         * Parser.cs: Add parameter that indicates if it's a prefix
277         operator. When building the MemberExprTail set to proper parent.
278         * PostOrPrefixOperator.cs: Partial implementation of ++ and --,
279         prefix and suffix, we assume that the operand is a variable.
280
281 2005-02-09  Cesar Lopez Nataren  <cnataren@novell.com>
282
283         * expression.cs: Added method EmitStore and EmitLoad to Identifier
284         class. Implemented op= operators. Fixes 72393.
285
286 2005-02-08  Cesar Lopez Nataren  <cnataren@novell.com>
287
288         * expression.cs (Identifier.Emit): Handle case where we are
289         assigning to a formal parameter. Fixes #72333.
290
291 2005-02-06  Cesar Lopez Nataren  <cnataren@novell.com>
292
293         * expression.cs: (load_script_func) Load localbuilder in an
294         invocation when needed, this let us have higher order functions,
295         which is lovely (Fixes #71129). Update calls to load_engine to new signature. 
296         * FunctionDeclaration.cs: Add LocalBuilder to TypeManager.locals
297         * Statement.cs: Changed ctr to Init, so we can track correctly the
298         parent hierarchy when building the ast of the program.
299         * TypeManager.cs: Added field locals. Factored code for
300         handling the tables. Added enums ManagedType and Operation.
301         * Parser.cs: Track correctly the parent of return.
302         * ast.cs (class Function): add ScriptBlock as possible parent of a
303         global expression.
304         * CodeGenerator.cs: change signature of load_engine. Instead of a
305         AST a boolean. So we can call it with InFunction as parameter.
306
307 2005-02-05  Cesar Lopez Nataren  <cnataren@novell.com>
308
309         * expression.cs: rework the late binding algorithm, we directly
310         call an object's method if it's a static method of it. Added field
311         late_bind, properties AccessField and Binding, renamed emit_access
312         to emit_array_access to class Binary. Added fields params_info,
313         late_bind and var_args to Class Args; also methods has_var_args,
314         force_strong_type, reworked its Emit code, we take care of methods
315         which have variable number of arguments, take care of needed
316         conversions and boxing when the call has specific strong types as
317         formal parameters. Added method IsPrint and property Parameters to
318         class BuiltIn.
319         * IdentificationTable.cs: Better implementation of jscript's
320         environments semantics. Added classes Symbol and Binder.
321         * SymbolTable.cs: Nuked.
322         * Block.cs: Fix the semantic of semantic analysis and code
323         generatipo process, we now allow forward declarations of variables
324         and functions.
325         * FunctionDeclaration.cs: Added default ctr and Init method. Fix
326         the semantics of the Resolve and Emit process, we can have forward
327         declaration of variables and functions. Fix order in which
328         JSLocalField's get build.
329         * FunctionExpression.cs: Fix order in which JSLocalField's get build. 
330         * VariableStatement.cs: Added methods EmitVariableDecls and PopulateContext.
331         * VariableDeclaration.cs: Added method EmitDecl. Delay the Resolve
332         and Emit process until the second phase.
333         * Statement.cs: Resolve process of For class take care of
334         VariableStatements for populating the environment in advance.
335         * TypeManager.cs: Make GetMethod return a MethodBuilder.
336         * ast.cs: Added field locals, property NumOfArgs, method GetName
337         to abstract class Function.
338         * SemanticAnalyser.cs: unified global environment and the stack of
339         contexts. Added field global_obj, adapt methods to new
340         IdentificationTable api. Delete method ObjectSystemContains. Added
341         method contains, is_js_object, object_contains_method, map_to_ctr,
342         get_member.
343         * Try.cs: Update to new IdentificationTable api.
344         * ScriptObject.cs, JSPropertyInfo.cs, FormalParameterList.cs,
345         JSFieldInfo.cs, JSMethodInfo.cs, JSLocalField.cs,
346         ScriptFunction.cs: use full namespace name for Binder.
347
348 2005-01-17  Cesar Lopez Nataren  <cnataren@novell.com>
349
350         * CodeGenerator.cs: Added load_engine.
351         * expression.cs (emit_func_call), FunctionDeclaration.cs: Fix
352         computation of VsaEngine.
353
354 2005-01-11  Cesar Lopez Nataren  <cnataren@novell.com>
355
356         * StringConstructor.cs: implement CreateInstance.
357
358 2005-01-10  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
359
360         * BooleanPrototype.cs: update to assert_type.
361         * SemanticAnalizer.cs: move BooleanPrototype.AssertType here, rename it to assert_type.
362
363 2005-01-06  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
364
365         * BooleanObject.cs: implement ctr's.
366         * BooleanPrototype.cs: back to M.J namespace. Implement contructor
367         property, toString and valueOf, add AssertType.
368
369         * Convert.cs: add ToString overload and implement.
370
371         * JSFieldInfo.cs, JSLocalField.cs: Add conditional NET_2_0 or BOOTSTRAP_NET_2_0 's
372         Mono_GetGenericFieldDefinition.
373
374         * StringObject.cs: add ctrs.
375
376 2005-01-05  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
377
378         * ObjectPrototype.cs: Add internal ctr. Implement hasOwnProperty.
379         * ObjectConstructor.cs: implemented CreateInstance.
380         * expression.cs (emit_create_instance): add Boolean case.
381         * Try.cs, Statement.cs (EmitStms), Literal.cs
382         (ObjectLiteralItem.Emit), CodeGenerator.cs (fall_false): delete
383         unused variables.
384
385 2004-12-15  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
386
387         * CodeGenerator.cs: add support for compiling not only from cwd.
388
389 2004-12-13  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
390
391         * expression.cs: emit code for null literal.
392
393 2004-12-06  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
394
395         * expression.cs: added StringConstructor case.
396
397         * MemberInfoList.cs: added internal classes Node, ListIter,
398         ChainHash and implement MemberInfoList.
399         * JSObject.cs: implement AddField, AddProperty, AddMethod,
400         GetMembers, RemoveMember, GetEnumerator, add ChainHash's ext
401         field.
402         
403
404 2004-11-30  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
405
406         * *Prototype.cs: return constructor.
407
408 2004-11-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
409
410         * GlobalObject.cs: return the different kinds of object's
411         constructors.
412         * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
413         NumberConstructor.cs, VBArrayConstructor.cs,
414         FunctionConstructor.cs, EnumeratorConstructor.cs,
415         BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs,
416         ActiveXObjectConstructor.cs : added default constructor and static
417         contructor field.       
418         * ErrorConstructor.cs: added default and discriminatory ctrs. Let
419         us know which type of error we are.
420         * DateObject.cs: add field that hold the millisecond representation of date.
421         * JSError.cs, JScriptException.cs: back to Microsoft.JScript namespace.
422         * DatePrototype.cs: add default ctr.
423         
424         * MathObject.cs: implement its methods.
425
426 2004-11-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
427
428         * DateConstructor.cs: runtime support, ported parse method from Rhino.
429
430 2004-11-22  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
431
432         * CodeGenerator.cs: (ff_emit_relational) receive a full
433         EmitContext as parameter. Added
434         ff_emit_equality_cond. (fall_false) take where of the case where
435         an expression is received.
436         
437         * Parser.cs: use ToJSToken for building the Relational
438         object. Map relational Token's to JSToken's.
439         * expression.cs: Added Size property to class
440         Expression. (emit_create_instance): Added Number code generation. 
441
442         * Relational.cs (Emit): fix typo, emit boxing to boolean.
443
444 2004-11-19  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
445
446         * NumericBinary.cs: implement EvaluateNumericBinary.
447
448 2004-11-15  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
449
450         * CodeGenerator.cs: factor code for fall_true/fall_false (add
451         emit_default_case, ft_binary_recursion, ft_emit_equality,
452         ff_emit_relational, ff_binary_recursion). Fix
453         trouble with logical ops code generation.       
454
455 2004-11-12  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
456
457         * TypeOf.cs, Plus.cs, Equality.cs:  implementation of
458         JScriptTypeOf, EvaluatePlus, EvaluateEquality.
459         * Convert.cs (ToString): use the IConvertible/TypeCode approach
460         for convertions. Add GetTypeCode.
461
462         * Parser.cs, expression.cs: discriminate among =, +=, -=, etc. Add overload of
463         ToJSToken.
464
465 2004-11-10  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
466
467         * expression.cs (emit_late_call): Pop after Call or CallValue when
468         needed. (New.Emit) add emit_create_instance.
469         
470
471 2004-11-08  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
472
473         * expression.cs (class New): add new operator support. Add
474         emit_args, implemented Emit.
475
476         * expression.cs: emit unary operator code.
477         * TypeOf.cs: back to Microsoft.JScript namespace. fix typo.
478         * Literal.cs: constrain more the case of negative numeric literal.
479
480         * expression.cs (emit_func_call): pop if function's return type is
481         non-void and has no effect. 
482
483 2004-11-07  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
484
485         * BinaryOp.cs: added constructor for instantiating derived classes.
486         * BitwiseBinary.cs, Equality.cs, In.cs, InstanceOf.cs,
487         NumericBinary.cs, Plus.cs, Relational.cs, StrictEquality.cs,
488         expression.cs (classes Binary, Assign): use inherited constructor. 
489         * BitwiseBinary.cs, Equality.cs: deleted public constructor which carried the context.  
490
491 2004-10-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
492
493         * StringObject.cs: add value field
494
495         * expression.cs: implement LateBinding. Added methods:
496         emit_late_binding, init_late_binding, emit_late_get_or_set,
497         get_global_scope_or_this, setup_late_call_args, load_script_func, emit_late_call
498         * Convert.cs: implement CheckIfDoubleIsInteger and CheckIfSingleIsInteger
499
500 2004-10-20  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
501
502         * ast.cs (Function): added method emit_return_local_field, if
503         there's a return stm inside a function we must allocate a
504         JSLocalField indicating the return type of the function.
505         * FunctionDeclaration.cs, FunctionExpression.cs: generate the
506         extra JSLocalField if needed
507
508 2004-10-19  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
509
510         * Parser.cs: set the operator properly.
511
512 2004-10-11  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
513
514         * GlobalObject.cs: ported encodeURI, encodeURIComponent,
515         decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode.
516         
517         * expression.cs (Call.Emit): implement IsConstructorProperty.
518
519 2004-10-06  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
520
521         * expression.cs: added support for function calls. Handle case of
522         print where no args are supplied.       
523
524 2004-10-05  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
525
526         * ast.cs: added GetContainerFunction property.
527         * Statement.cs: added class NotVoidReturnEventArgs and delegate
528         NotVoidReturnEventHandler, throw an event in case we find a
529         return, the enclosing function object takes care of changing the
530         return type of the function.
531         * FunctionDeclaration.cs, FunctionExpression.cs: take care of
532         return's inside functions.
533
534 2004-09-22  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
535
536         * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField.
537
538         * Parser.cs: use ToJSToken to set the operator properly.
539         * FunctionDeclaration.cs: delete spaces.
540
541 2004-09-21  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
542
543         * FunctionDeclaration.cs: check for parent being a ScriptBlock.
544
545 2004-09-20  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
546
547         * expression.cs: added semantic analysis for accessing fields on
548         class Binary. Semantic Analysis for Calls it takes care of
549         constructors and methods, added invocation code for built in
550         methods. Added interface IAccesible that let us resolve the '.'
551         operator. Class Args handles missing or surplus arguments. Added
552         class BuiltIn which will take care of all builtins of ECMAScript.
553         * ast.cs: added check for parent equal to ScriptBlock.
554         * SymbolTable.cs: added method Remove.
555         * Statement.cs: Added abstract class Jump of which Continue and
556         Break inherit, checks the label stuff. Added checks for Label
557         stuff to Continue and Break classes. Added method Init for
558         DoWhile. Fixes for loops statements in order to be able for have
559         nested loops. Initial support for Label statements.
560         * SemanticAnalizer.cs: added hash global_env and
561         IdentificationTable label_set for keeping track of global methods and
562         label sets. Added static constructor, method BuildGlobalEnv,
563         ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel,
564         GetLabel, RemoveLabel.  
565         * Relational.cs: added code generation for ops instanceof and
566         in. Fixes for usual relational ops.
567         * Parser.cs:fixes to keep track of the inheritance chain.
568         * MathObject.cs: added internal constructor.
569         * JSFunctionAttribute.cs: added fields value and built_in_function
570         so we can decide when a method is really a built in.
571         * IdentificationTable.cs: added method Remove.
572         * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression.
573
574 2004-08-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
575
576         * expression.cs: made Binary is IAssignable, added fields assign
577         and right_side, added method ResolveAssign (which now receives an
578         extra parameter, being the right side of the assigment). Take care of being
579         inside a function for array indexing. Take care of lvalue case
580         too. Assign.Emit just calls left.Emit since left knows everything
581         about the right side of the assigment after Resolve process.
582         * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
583         * BinaryOp.cs: renamed current_op to op as with the new
584         parser we no longer need to keep track of the old_op.
585
586 2004-08-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
587
588         * expression.cs: do not pass the operand as a parameter to the
589         constructor as it gets after the parent gets constructed, same
590         with binary. Added code generation for array index access.
591         * Parser.cs: added ToJStoken which converts Token to JSToken,
592         factored the code for creation the Unary nodes. Take care of
593         parent relationship.
594         * LateBinding.cs: back to Microsoft.JScript namespace.
595         
596
597 2004-08-23  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
598
599         * Parser.cs: pass the skip_count to ArrayLiteral constructor.
600         * Missing.cs: back to Microsoft.JScript namespace.
601         * ArrayLiteral.cs: added field skip_count, it tells us if this is
602         a spaced-arrayliteral, in which case we add a null value in the
603         list, added null check in the resolve and code generation process.
604
605 2004-08-21  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
606
607         * expression.cs: added interface ICallable and and function AddArg
608         to class Call. Added class New.
609         * driver.cs: made it use the new lexer and parser.
610         * ast.cs: added field line_number, added property InFunction,
611         added class Function that factores all the code shared between
612         FunctionDeclaration and FunctionExpression.
613         * With.cs: constructor receives line number.
614         * VariableStatement.cs: constructor receives line number.       
615         * VariableDeclaration.cs: Added check for parent being
616         FunctionDeclaration and FunctionExpression.
617         * Try.cs: Moved the code that used to take care of the catch to
618         Catch class. Constructor receives forming elements and line
619         number. Removed mangle_id.
620         * Throw.cs: constructor receives line number.
621         * Statement.cs: If, DoWhile, Return  constructor receives line number. Renamed
622         identifier to label in Continue and Break class, its constructor now
623         receives the label and line number. For class, constructor
624         receives its forming parts. Switch class, constructor receives
625         line number, added function AddClause and AddStm. Added class
626         Catch. Added class Labelled.
627         * SemanticAnalyser.cs: Added field anon_method_counter, properties
628         NextAnonymousMethod and CurrentAnonymousMethod.
629         * Parser.cs: function ArgumentList receives a ICallable list
630         instead of a AST. Now we add the arguments of a callable. Build
631         Call's ast.
632         * Literal.cs: added constructor for 'this' literal and
633         ObjectLiteral constructor. Added RegExpLiteral class, will take
634         care of regular expressions semantic analysis and code generation.
635         * JSScanner.cs: use no more the antlr based lexer. Fix typo.
636         * JSParser.cs: make it use the new port of Rhino's Parser.
637         * FunctionObject.cs: Added constructor that receives the function name.
638         * FunctionExpression.cs: made it inherit from Function class. Added
639         constructor. Factored the code that used to set the prefix to
640         Function.set_prefix (it's shared with FunctionDeclaration). Added
641         fields local_script_func and field. Implemented Resolve and Emit
642         (now we can do: var x = function (this, method, is, anonymous) {... };).        
643         * FunctionDeclaration.cs: made it inherit from Function class in
644         order to share code with FunctionExpression. Added new
645         constructor. Moved the code that used to built the prefix to
646         Function inside function set_prefix. When building the closure
647         added check for  setting the type of a FunctionExpression. Moved
648         set_function_type and set_custom_attr to class Function. 
649         * ForIn.cs: added constructor and fields lhs, obj and body.
650         * Block.cs: added default constructor and line number based
651         constructor. Check for elems not being null before adding.
652         * ArrayLiteral.cs: set elements in constructor.
653         
654 2004-07-29  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
655
656         * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
657         building the other block was not needed. Build the ast's for the
658         expressions and statements, keep track of the parent relationship.
659
660 2004-07-19  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
661
662         * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
663         Mozilla/Rhino's  parser.
664
665 2004-06-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
666
667         * jscript-lexer-parser.g: added ast building for object_literal,
668         it's disabled for now while I fix the "block Vs object_literal"
669         non-determinism problem on the parser. Added rule for
670         array_literal. Build PropertyName ast build.
671         * Literal.cs: fixed the negative numbers code generation (we must
672         optimize this). Added initial ObjectLiteral's class, code generation and
673         Resolve process. Added class ObjectLiteralItem and PropertyName.
674         * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
675         elisions we keep track of the "real" size here. Added constructor. Added initial
676         Resolve and Emit code.
677         * ASTList.cs: added Size property. 
678         * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
679
680 2004-06-20  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
681
682         * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
683         break and continue in order to jump to the desired place. Added
684         check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
685         * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
686         need to jump if the expression evaluates to true. Continue class,
687         replaced ParentIsItrStm with InLoop, emit jump to correct
688         place. Break class, implemented Resolve; deleted
689         ParentIsCorrect. DoWhile, While classes, set LoopBegin and
690         LoopEnd. While class, set LoopBegin and LoopEnd. 
691         * ast.cs: Added InLoop and InSwitch.
692         * jscript-lexer-parser.g: pass parent to break_stm. Added block as
693         a statement. Temporarily disabled object_literal in order to test
694         the block structure and continue and break statements.
695         
696 2004-05-28  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
697
698         * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
699         property. Added initial pieces for Break's Resolve. Fixed bug that
700         did not let Emit the code for case clauses that came after the
701         default clause (we match the jsc behavior).
702         * jscript-lexer-parser.g: set parent of switch's clauses.
703
704 2004-05-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
705
706         * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
707         * jscript-lexer-parser.g: set parent hierarchy for continue
708         statement. Set to correct parent in iteration_stm.
709
710 2004-05-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
711
712         * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
713
714         * Statement.cs: Added code generation support for 'switch' statement.
715
716         * jscript-lexer-parser.g: added 'using' for
717         System.Collections. Allow 'switch' statement building of its
718         ast. Added parent parameter to constructor of With. Build
719         inside_for ast. 
720
721         * With.cs: code generation support for 'with' stm.
722
723 2004-05-21  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
724
725         * Statement.cs: initial code generation of 'for'.
726         * jscript-lexer-parser.g: let's build for's ast.
727
728 2004-05-18  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
729
730         * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
731         * expression.cs: handle Try case for field or local vars allocation. 
732         * Try.cs: implemented Emit.
733         * Throw.cs: implemented code generation.
734         * FunctionDeclaration.cs: cache some values.
735
736 2004-04-26  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
737
738         * FunctionDeclaration.cs: let's make function name formation
739         (get_name ()) a little bit less dumb. We cache the prefix now so
740         we don't have to recalculate it everytime.
741
742 2004-04-22  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
743
744         * Literal.cs: emit the correct code for negative numbers.
745         * jscript-lexer-parser.g: set parent unary_expr.
746
747 2004-04-18  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
748
749         * expression.cs: added code generation for 'x1 ? x2 :x3' op.
750         * Statement.cs: Added code generation for while and do-while.
751
752 2004-04-17  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
753
754         * Statement.cs (class if): reimplemented Emit based on fall_false.
755         * Equality.cs: added code generation for != and emit jumping code
756         only in the case we are at a global expression not statement.
757         * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
758         boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
759
760 2004-04-14  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
761
762         * expression.cs (Binary.Emit): treat boolean operator
763         specially. Added emit_jumping_code.
764         * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
765         fall_false, which will express all boolean expressions and control
766         flow conditions. 
767
768 2004-04-02  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
769
770         * Equality.cs: Moved the Emit and Resolve code here.
771         * jscript-lexer-parser.g: Build a Equality object instead of a
772         Binary object for equality_expr.
773         * expression.cs: moved equality oeprators (resolve and IL gen) to
774         Equality.Emit and Equality.Resolve.
775
776 2004-03-31  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
777
778         * expression.cs: Added shift operators IL emit.
779         * BitwiseBinary.cs: added constructor for building it according to
780         JSToken enum. return a new object on EvaluateBitwiseBinary (this
781         needs a real implementation).
782         * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
783
784         * Statement.cs: added stub for While and DoWhile ast
785         representation (reworking my Emit code).
786         * jscript-parser-lexer.g: allow iteration statement ast build.
787
788         * FunctionDeclaration.cs: agrouped code for setting custom attribute.
789
790         * expression.cs: added Modulo operator case.
791
792 2004-03-16  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
793
794         * Convert.cs: added rule for string conversion.
795
796         * Plus.cs: added rule for string addition.
797
798         * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
799         Emit (cases where there's no real operator).
800
801         * StringLiteral.cs: now implements Exp as can appear as a simple
802         exp in global code. Added check for Pop generation.
803
804         * expression.cs: added IL generation code for print func call. 
805         Args class added get_element, Size and made Resolve behave as the
806         others (collect the differents Resolve's return values from each
807         of the arguments). Expression class, added default Resolve call
808         for non-Exp implementers.
809
810         * jscript-lexer-parser.g: postfix_expr rule now returns a simple
811         AST, this handles the case where no postOrPrefixOp present; Unary
812         returns an AST too.
813
814         * FormalParameterList.cs: added get_element, retrieves nth element.
815
816 2004-03-14  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
817
818         * ScriptStream.cs: let's print some messages.
819
820         * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
821
822 2004-03-13  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
823
824         * jscript-lexer-parser.g: keep track of return's parent.
825         * Statement.cs: added parent parameter to constructor.
826
827         * expression.cs: refactored Emit code from Identifier, now we take
828         care of function's paramenter references. First attack to function
829         calls, check if Resolve from Call succeed.
830         
831         * VariableDeclaration.cs: Deleted Decl class, field_info and
832         local_builder fields were being used only by VariableDeclaration,
833         I'll keep them there.
834         
835         * FormalParameterList.cs: added field pos to FormalParam, and set
836         it at FormalParameterList's Resolve stage. 
837         
838         * TODO: updated TODO.
839
840 2004-03-07  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
841
842         * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
843
844         * expression.cs: At class Conditional renamed fields. Class
845         Expression inherits from Exp as we must keep track if we must pop
846         the last value (this is for the comma operator), track the parent,
847         at Resolve we take care of the last value of the expression, 
848
849         * VariableDeclaration.cs: updates needed because of EmitContext change.
850
851         * Statement.cs: added parent param to If constructor. Implement
852         Resolve and Emit for If statement.
853
854         * Relational.cs: Set parent. The boxing happens in the containing statement.
855
856         * FunctionDeclaration.cs: Added func_type field, will be used to determine the
857         type of the function we are generating (global function, method
858         from a class, etc) and attach to it the correct custom
859         attribute. Simplified the code for nested functions: 
860         refactored the code so no code duplication is involved, now we
861         have only one function that retrieves  the name of the function,
862         now create a new EmitContext for the body of the method.
863
864         * FormalParameterList.cs, Literal.cs, StringLiteral.cs:  use
865         current EmitContext's ILGenerator. 
866
867         * Convert.cs: Do not throw the NotImplementedException anymore for
868         method ToBoolean, for now we always return false. This must get a
869         real implementation.
870
871         * CodeGenerator.cs:  Deleted one of ILGenerator fields
872         from EmitContext, suffices using only one (more notes about the
873         change on the Functiondeclaration entry). Imitate jsc behavior for
874         compiled files names, aggregate the exe or dll extension after last dot.
875
876         * Block.cs: In order to implement the comma operator (i.e., expression,
877         assign_exp), we must track if our expressions are at a global
878         scope, in which case we must pop the last result too.
879
880 2004-01-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
881
882         * Relational.cs: Initial generation of CIL for relational operators.
883
884 2004-01-23  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
885
886         * jscript-lexer-parser.g: formal_param_list receives a parent too.
887
888         * SymbolTable.cs: added size and current_symbols properties.
889
890         * JSLocalField.cs: don't throw not ImplementedException from
891         constructor (same reason, testing purposes, must get implemented
892         for real).
893
894         * IdentificationTable.cs: added num_of_locals and current_locals properties.
895
896         * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
897         as fields. Not throw NotImplementedException for
898         JScriptFunctionDeclaration (testing purposes, must get implemeted
899         for real). Let's build our function closures! Added functions:
900         build_closure and build_closure_nested, build_local_fields. Keep
901         track of current parameters and locals defs.
902
903         * FormalParameterList.cs: made FormalParam inherit from
904         AST. Implement the Emit for parameters, yeah!
905
906         * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.   
907
908         * Closure.cs: do not throw the exception (this allow me to run the
909         tests  at mcs/jtests and check that at least i'm not generating
910         invalid CIL). Be aware that this must be really implemented.
911
912         * Block.cs: renamed field, and implement the double pass for
913         nested function declarations code emittion, yeah!.
914
915 2004-01-16  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
916
917         * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
918         * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr, 
919         * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
920         * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
921         * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
922
923         * UnaryOp.cs: inherit from Exp now.
924         * Plus.cs: Don't throw the exception when calling constructor, let
925         it build the default handler. Return a new object when calling
926         EvaluatePlus until properly implemented.
927
928         * NumericUnary.cs: added new Resolve.
929         * NumericBinary.cs: assign operator val at ctr. Return a new
930         object when calling EvaluateNumericBinary until properly
931         implemented. Added Resolve.
932         * Equality.cs: added ctr and return false for EvaluateEquality
933         until properly implemented. Added Resolve's functions.
934
935         * Block.cs (Resolve): That check was not necessary.
936         
937         * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
938         StrictEquality.cs, TypeOf.cs: added Resolve inherited from
939         BinaryOp and UnaryOp, and this from Exp.
940         * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
941         * jscript-lexer-parser.g: deleted debugging messages. Create a
942         Assign object instance of a simple Binary obj. Same case for Equality.
943
944         * expression.cs: added Exp abstract class. Classes that are ast of
945         language constructions that can appear as global expressions that
946         get evaluated and then the result is discarded inherit from this
947         new class. This let meee keep track of things that must get Popped
948         or can even avoid the evaluation of it. Wrote real Resolve method
949         for classes: Unary, Binary.
950         Implemted Emit method for some binary operations (+, -, / and *),
951         for other operators some more code is still missing.    
952         Identifier: handle assignment cases and global exp cases.
953         Added class Assign (compisite assignment still missing tough :-(
954
955         * driver.cs: deleted debug messages, added "Compilation Succeeded"
956         message ;-).
957         * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.      
958         * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
959         Exp and handle the case for global expressions that must be popped
960         after evaluation. no more invalid IL being generated! yeah!
961         * Block.cs: wrote real Resolve method, erased debug messages.
962         * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
963         * BinaryOp.cs, Conditional: now inherits from Exp.
964
965 2004-01-15  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
966
967         * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
968
969         * CodeGenerator.cs: small fixes to generate same things that ms.
970
971 2004-01-13  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
972
973         * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
974
975 2004-01-12  Atsushi Enomoto  <atsushi@ximian.com>
976
977         * JSMethodInfo.cs : tiny fix for NET_2_0 build.
978
979 2003-12-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
980
981         * jscript-lexer-parser.g: keep track of parent reference for
982         IDENTIFIER, STRING_LITERAL.
983
984         * expression.cs: Added 'binding' field. Added 'parent' parameter
985         to constructor. Now we emit the proper code for the identifier.
986
987         * VariableStatement.cs: updated to field names instead of the old
988         property's name.
989
990         * VariableDeclaration.cs: Added class Decl, it constains the
991         references to the static field or LocalBuilder that are created
992         when a declaration is emitted. Deleted unuseful properties (Id,
993         InitValue, Type).
994
995         * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
996         object instead of a boolean.
997
998         * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
999
1000         * IdentificationTable.cs: Deleted Retrieve method. Contains method
1001         now return an object instead of a boolean, that reference is the
1002         binding associated with the identifier being searched.
1003
1004 2003-12-18  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1005
1006         * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
1007
1008         * VariableDeclaration.cs: now I handle initialization (ex. var x =
1009         2; or function f () { var x = 4; }) at global scope or at
1010         function's body.
1011
1012         * Literal.cs: Added parent param to NumericLiteral constructor.
1013
1014         * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
1015
1016 2003-12-17  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1017
1018         * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
1019
1020 2003-12-10  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1021
1022         * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
1023         "instanceof"; }' in order to be able to parse both keywords. When
1024         generating the parser, one warning about nondeterminism
1025         (k==1:"in") is generated ignore it.
1026
1027 2003-12-07  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1028
1029         * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
1030         not parsable now they are. Mozilla's and Janet's  test suites are
1031         being really helpful.
1032
1033 2003-12-05  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1034
1035         * jscript-lexer-parser.g: added check for non-null reference at
1036         var_decl_list rule. Added single quote STRING_LITERAL lexical rule
1037         and multiple lines comments rule.
1038
1039         * jscript-lexer-parser.g: Now I keep track of the parent for most
1040         of the syntatic constructs. Fixed object_literal rule.
1041
1042         * ast.cs: Added field parent. This will help me to track nested
1043         blocks for all of the syntatic constructs and will allow to Emit
1044         everything in one single pass.
1045         * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
1046         parent stuff.
1047         * Block.cs, FunctionObject.cs: deleted parent field as AST will
1048         hold it. Delete parent parameter from constructor.
1049         * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
1050         EmitContext class. The idea is Emitting everything in one pass (decls
1051         and 'Global Code' method, the parent reference let me know which IL
1052         generator use, gc_ig or ig).
1053         * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
1054         constructor. Use new parent reference for choosing the IL
1055         generator. NumericLiteral a 'hard coded' int32 IL emittion added
1056         for testing. 
1057         * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
1058         the parent reference to infere which IL generator to use.
1059         * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
1060         reference to infer which IL generator to use.
1061         * expression.cs: Added paramenter parent to constructor of: Unary,
1062         Binary, Conditional, Call.
1063
1064 2003-11-30  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1065
1066         * expression.cs: Added new field to Call class, so it can handle more arguments.
1067
1068         * StringLiteral.cs (Emit) : Load the string value.
1069
1070         * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
1071
1072         * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
1073         custom attribute. Build default 'JScript 0' constructor. Emit
1074         default initial/final code of 'Global Code'. Create default
1075         'JScript Main'.
1076
1077 2003-11-29  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1078
1079         * jscript-lexer-grammar.g: define new rule 'arguments' instead of
1080         repeating hand written rule all around. Change "." for DOT, dumb
1081         mistake by myself. Added rule new_expr. Now we handle properly the
1082         call_expr rule (as defined on the spec), and added a new
1083         argument. Added subrule new_expr to  left_hand_side_expr rule.
1084
1085 2003-11-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1086
1087         * expression.cs (Expression): implemented Emit.
1088
1089         * expression.cs (Binary): Emit now creates a local for the
1090         different kinds of binary expressions (initial code for this).
1091
1092         * ast.cs: Emit method now is abstract instead of virtual.
1093
1094         * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
1095
1096         * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
1097         Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
1098         FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
1099         NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
1100         Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
1101         Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
1102         Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
1103         Conditional, Call, Identifier, Args, Expression, :
1104         added Emit method.
1105
1106         * FunctionDeclaration.cs: Check if values are not null first (at
1107         Resolve). Ignore code generation is at 'Global Code'.
1108
1109         * VariableDeclaration.cs: Now I take care of IL generation when we
1110         are at statements and expressions at global code, 'Global Code'
1111         method is populated with that IL.  
1112
1113         * CodeGenerator.cs: Added flag for 'Global Code' method
1114         emittion. Now I call 'Emit' twice. The first for declarations the
1115         follower for statements and expressions at global scope.
1116         
1117 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
1118
1119         * Visitor.cs: Deleted.
1120
1121 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
1122
1123         * FormalParameterList.cs: Now inherits from AST. Each of the
1124         formal parameters gets into the IdentificationTable at Resolve.
1125
1126         * FunctionDeclaration.cs:Resolve (), We open a new block when
1127         encountering a FunctionDeclaration, resolve de parameters and the
1128         body, at the end we close the block.
1129
1130         * IdentificationTable.cs: Now we keep track of parent of the
1131         current block. 'Enter (...)' now receives an object, not a
1132         VarDecl. 'Contains' now take care of searching through the binding
1133         chain.
1134
1135         * Literal.cs: Deleted 'Literal' class, was being used for
1136         nothing. All the classes the inherited from it, now do it from
1137         AST. A 'literal' does resolve to true by default.
1138
1139         * Relational.cs: Resolve recursively left and right.
1140
1141         * SemanticAnalyser.cs: added flag for 'print statement'.
1142
1143         * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
1144         and false_stm.
1145
1146         * driver.cs:  Init the semantic analysis phase.
1147
1148         * expression.cs: 'Unary' class, resolves its operand
1149         first. 'Binary' class,resolves left and right first. 'Args' class
1150         resolve all the formal parameters first. 'Expression' resolve all
1151         the nested expressions first.
1152
1153         * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
1154         
1155 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
1156
1157         * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
1158         this is temporal in order to get Factorial compiled by mjs (must
1159         build the types according to Ecma-262 spec).
1160
1161         * Literal.cs: Added NumericLiteral class.
1162
1163 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
1164
1165         * FunctionDeclaration.cs: Build a ScriptFunction local variable,
1166         if inside a nested block.
1167
1168 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
1169
1170         * jscript-lexer-parser.g: Now we take care of parents. This allows
1171         to keep track if we are inside nested blocks. At
1172         'func_decl_or_expr', now I built the FunctionDeclaration or
1173         FunctionExpression first and then assign its body to it - this let
1174         me get a non-null value of the FunctionExpression or
1175         FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
1176
1177         * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
1178         * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
1179         FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
1180
1181         * ScriptBlock.cs: Initiate the global block with 'null' as parent.
1182         
1183         * FunctionDeclaration.cs: Added 'get_composite_name ()' method
1184         (gets the name of a function if it's nested). Emit code for
1185         function's body. At 'Emit ()' now we take care if it's a nested
1186         declaration.
1187
1188         * FunctionObject.cs: default return type is 'void' not
1189         'Object'. Function declarations without parameters map to functions with
1190         'Object this' and 'VsaEngine engine' as parameters by
1191         default. Assign parent to nested block.
1192
1193         * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
1194         a global declaration or inside a function declaration.
1195         
1196 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
1197
1198         * FunctionObject.cs: Handle no parameters on functions.
1199         
1200         * jscript-lexer-parser.g: Allow functions without parameters.
1201
1202 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
1203
1204         * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
1205         DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
1206         FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
1207         InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
1208         Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
1209         Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
1210         Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
1211         With.cs, expression.cs : Added 
1212         'Resolve' method stub.
1213
1214         * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
1215
1216         * FormalParameterList.cs: Added FormalParam class. Change Add
1217         method to receive the id and the type annotation from function's parameters.
1218
1219         * FunctionDeclaration.cs: Added code for initial function's
1220         definition code generation.
1221
1222         * FunctionObject.cs: Added MethodAttributes and type_annot
1223         fields. Added params_types function, which returns an array of
1224         types from each of the function's parameters.
1225
1226         * IdentificationTable.cs: Added ToString method.
1227
1228         * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
1229         and add it again with the correct name). Not based on the Visitor
1230         pattern anymore. Deleted all the VisitFOO methods. Added a
1231         IdentificationTable field. Added Run, Dump methods.
1232
1233         * Statement.cs: Deleted Statement class (it was being used for
1234         nothing). All classes that were having Statement as parent,
1235         changed their parent to be AST.
1236
1237         * SymbolTable.cs: Added Add method that receives the id and the
1238         declaration class. Retrieve changed to return an AST. Added
1239         ToString method. Added 'SymbolTable parent' field.
1240
1241         * VariableDeclaration.cs: Added InitValue property.
1242
1243         * ast.cs: Added some comments and abstract method 'Resolve'.
1244
1245         * jscript-lexer-parser.g: Added parsing support for formal
1246         parameters type annotations.
1247         
1248 2003-10-30  cesar lopez nataren <cesar@ciencias.unam.mx>
1249
1250         * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
1251         thanks to Hector!) 
1252
1253 2003-10-28  cesar lopez nataren <cesar@ciencias.unam.mx>
1254
1255         * jscript-lexer-parser.g: allow empty program files. Added type
1256         annotations on var decl and function decl.
1257         * VariableDeclaration.cs: added return type annotation field.
1258         * FunctionExpression.cs: added return type parameter to constructor.
1259         * FunctionDeclaration.cs: added return type parameter to
1260         constructor. Added Emit method (just creates the static field at
1261         the global object, for now).
1262         * FunctionObject.cs: added return type to constructor. Changed
1263         names to readable ones ;-) 
1264
1265         * ScriptStream.cs: added WriteLine.
1266
1267 2003-10-24  cesar lopez nataren <cesar@ciencias.unam.mx>
1268
1269         * ast.cs: Added 'virtual' Emit method (I might change it to be
1270         abstract, but I would have to added to all classes that derive
1271         from it. I'll do it later)
1272         * Block.cs: Added Emit method.
1273         * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
1274         anymore) - still missing some methods, ut on the way. A nice
1275         hacking weekend coming. Added EmitContext class.
1276         * ScriptBlock.cs: Added Emit method.
1277         * VariableDeclaration.cs: Changed type field from string to
1278         Type. Added Emit method.
1279         * VariableStatement.cs: Added Emit method.
1280         * driver.cs: Added CodeGeneration phase (only simple var
1281         declarations support it. More coming soon).
1282
1283
1284 2003-10-22  cesar lopez nataren <cesar@ciencias.unam.mx>
1285
1286         * statement.cs: added Return class.
1287
1288         * Throw.cs: Added expression field, constructor and ToString.
1289         
1290         * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
1291         building.  
1292         
1293         * With.cs: added constructor and ToString. Back to the non-tmp
1294         namespace.
1295
1296         * jscript-parser-lexer.g: allow with_stm tree building.
1297
1298         * jscript-lexer-parser.g: changed the return type from if_stm from
1299         'If' to AST. Added tree for continue_stm. Allowed building of
1300         Break tree.
1301
1302         * statement.cs: switched to internal 'If' class. Added Continue
1303         class. Added Break class.
1304         
1305         * jscript-lexer-parser.g: build tree for function decl or expr.
1306
1307         * FunctionDeclaration.cs: added internal constructor.
1308
1309         * FunctionExpression.cs: added internal constructor.
1310
1311         * FunctionObject.cs: added internal constructor and ToString method.
1312
1313         * jscript-lexer-parser.g: added building tree for if_stm.
1314         * Statement.cs: Added if class for 'if' statement.
1315         
1316
1317 2003-10-21  cesar lopez nataren  <cesar@ciencias.unam.mx>
1318
1319         * VariableDeclaration.cs: added the initializer to ToString.
1320         
1321         * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
1322         trees) building.
1323         
1324         * Block.cs, Equality.cs, Relational.cs: modified ToString 
1325
1326         * Equality.cs, Relational.cs, StringLiteral.cs,
1327         VariableDeclaration.cs: Added constructor 
1328
1329         * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
1330         name convetion style to mono style.
1331
1332         * UnaryOp.cs: added operator and operand fields.
1333
1334         * VariableDeclaration.cs: chenged field name from assignExp to val.
1335
1336         *  BinaryOp.cs: Made "internal" the attributes, added the two
1337         operators holders.
1338
1339         * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
1340         
1341         * driver.cs: Dump the string representation of the parsed exps.
1342
1343         * Literal.cs:  added BooleanLiteral
1344
1345         * Relational.cs: added constructor, ToString, 
1346
1347 2003-10-10  cesar lopez nataren <cesar@ciencias.unam.mx>
1348
1349         * README: added some info about hacking the grammar
1350
1351         * JSparser.cs: Updated the constructor to not receiving params.
1352
1353         * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
1354         JScriptParserTokenTypes.txt: update of antlr generated files from
1355         grammar changes. 
1356
1357         * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
1358         can parse a little bit more useful programs like:
1359
1360         function factorial (i)
1361         {
1362                 var k;
1363
1364                 if (i <= 0)
1365                         return 1;
1366                 else {
1367                         k = factorial (i - 1);
1368                         return i * k;
1369                 }
1370         }
1371
1372         var x;
1373         x = factorial (4); 
1374         print (x);
1375
1376         As you can see, it's not the classic factorial function
1377         definition, I still have to make some tricks like storing the
1378         result from the recursive call and then multiply. But this new
1379         grammar it's easier to alter than the old one. Also we got support
1380         for for-in statements, for statements, global expressions, support
1381         for object accesors or better known as the "dot" operator. Two
1382         rules are on the eye: left_hand_size_expr and call_expr, in order
1383         to finish the parsing grammar and fix the bugs.
1384
1385
1386 2003-09-29    <cesar@ciencias.unam.mx>
1387
1388         * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
1389
1390         * Added VsaItem.cs, implements IVsaItem.
1391
1392 2003-09-28    <cesar@ciencias.unam.mx>
1393
1394         * VsaItems.cs: Check that no name is repeated (this was docs fault
1395         :-)). This is the beauty of testing.
1396
1397         * Add VsaItems.cs, implements IVsaItems.
1398
1399 2003-09-22    <cesar@ciencias.unam.mx>
1400
1401         * DocumentContext.cs: changed constructor from internal to public,
1402         this a kind of hack ;), but we can build mjs.exe with that change.
1403
1404         * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
1405         VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
1406         StringLiteral.cs, StringConstructor.cs, Statement.cs,
1407         ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
1408         ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
1409         Package.cs, ObjectConstructor.cs, NumberObject.cs,
1410         NumberConstructor.cs, MathObject.cs, Literal.cs,
1411         LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
1412         JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
1413         JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
1414         JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
1415         IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
1416         FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
1417         FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
1418         ErrorConstructor.cs, EnumeratorObject.cs,
1419         EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
1420         DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
1421         BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
1422         BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
1423         ActiveXObjectConstructor.cs, ActivationObject.cs: 
1424
1425         indentation comformance to mono style. Returned to
1426         Microsoft.JScript namespace name. Now we can build
1427         Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
1428         linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
1429         $(CSC) /r:Microsoft.JScript.dll  driver.cs. Also changed my mind
1430         about the namespace stuff, because I want people 
1431         to contribute NUnit tests for Microsoft.JScript public API.
1432                 
1433         * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
1434
1435 2003-09-21    <cesar@ciencias.unam.mx>
1436
1437         * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
1438
1439 2003-09-20    <cesar@ciencias.unam.mx>
1440
1441         * jscript-lexer-parser.g: We are little bit closer to the spec on
1442         StringLiteral definition.  
1443
1444         * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
1445
1446         * jscript-lexer-parser.g: Build ast for FunctionExpression.
1447
1448         * JSObject.cs: we don't throw NotImplementedException anymore,
1449         this let us use FunctionExpression to build the ast.
1450
1451         * FunctionExpression.cs: Added a FunctionObject as field, a
1452         default constructor.
1453
1454         * FunctionObject.cs: Added default constructor.
1455
1456         * driver.cs: Deleted the Jsc class. We are not generating code
1457         now. I'm moving to provide something like mcs's EmitContext
1458         instead of the CodeGenerator class having the Reflection.Emit
1459         builders and ILGenerator. This driver is just for Lexical and
1460         Parsing phases testing.
1461
1462         * driver.cs: Now we are using the Microsoft.JScript public API
1463         functions to load the lexer and parser.
1464
1465         * ScriptBlock.cs,Block.cs: Added ToString function.
1466
1467 2003-09-20    <cesar@ciencias.unam.mx>
1468
1469         * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
1470         DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
1471         FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
1472         Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
1473         Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
1474         Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
1475         Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs, 
1476         : erased Visit method and made some mono indentation style changes.
1477
1478         * CodeGenerator.cs: commented some function calls.
1479         * FunctionDeclaration.cs: moved function attributes to
1480         FunctionObject class, erased Visit method.
1481         * FunctionObject.cs: Here is where we store a function
1482         expression/declaration info, erased Visit method.
1483         * ScriptBlock.cs: Added a Block field, Block will contain the
1484         source elements.
1485         * jscript-lexer-parser.g: updated the grammar to build the program
1486         representation based on ScriptBlock.
1487
1488 2003-09-19    <cesar@ciencias.unam.mx>
1489
1490         * JSToken.cs: public API compliance.
1491
1492 2003-09-07 Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1493
1494         * Context.cs: Added constructor and Document field.
1495         * DocumentContext.cs: Added Name field.
1496         * JSParser.cs: Integration of antlr's generated parser with
1497         JSParser public API. ScriptBlock is now the principal data structure that
1498         represents a Jscript .Net program.
1499         * JSScanner.cs: Integration of antlr's generated lexer with
1500         JSScanner public API.
1501
1502 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1503         * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
1504
1505 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1506
1507         * jscript-lexer-parser.g: Changed the namespace to
1508         Microsoft.JScript.Tmp.
1509
1510         * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
1511
1512         * jscript-lexer-parser.g: Got the name of a
1513         global_function_declaration and also its return type if
1514         available. 
1515
1516         * jscript-lexer-parser.g: Added syntatic rule for print_statement.
1517         * jscript-lexer-parser.g: Initial construction of AST for
1518         enum_statement and package_statement.
1519
1520         * jscript-lexer-parser.g: Fixed the enum_statement to accept
1521         empty enum declarations.
1522
1523         * jscript-lexer-parser.g: Got the type of a
1524         veriable_declaration.
1525
1526         * jscript-lexer-parser.g: Initial construction of AST for
1527         primary_expression (in particular literal).
1528
1529
1530 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1531
1532         * driver.cs: Modified the driver structure to be compatible
1533         with our new CodeGenrator and SemanticAnalizer. I
1534         removed the builders from Reflection.Emit to the
1535         CodeGenerator. Added an ASTList, SemanticAnalizer and
1536         CodeGenerator here. Adde methods Run, GenerateCode
1537
1538
1539 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1540         * Statement.cs: Forgot to include it on last commit.
1541
1542 2003-07-27  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1543         
1544         * Decided to change temporarly namespace name
1545         Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
1546         to run the code generated by our CIL code generator (on  next
1547         commit will come). The problem is that we don't have the
1548         runtime support for our compiler, this involve VsaEngine class
1549         and its "friends", which I have not found a lot of
1550         doumentation for. If someone knows a docs place for them,
1551         don't hesitate to send me a email pointing to them.
1552
1553         * Changed from public to internal Visit function at some
1554         classes.
1555
1556         * Package.cs: Added Name and Members fields.
1557         
1558         * SemanticAnalizer.cs: Added methods VisitPrint and
1559         VisitStringLiteral.
1560
1561         * VariableDeclaration.cs: Added Type field.
1562
1563         * Visitor.cs: Changed from public to internal. Added
1564         VisitPrint and VisitStringLiteral methods.
1565
1566         * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
1567         Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
1568         
1569
1570
1571
1572 2003-07-22  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1573
1574         * Added CmdLineError.cs and JSError.cs, last night I forgot to
1575         commit them.
1576
1577 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1578         * Added files:
1579         ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs, 
1580         BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs, 
1581         CmdLineException.cs, CmdLineOptionParser.cs, 
1582         ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs, 
1583         DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs, 
1584         ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs, 
1585         FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs, 
1586         Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs, 
1587         JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs, 
1588         JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs, 
1589         LenientArrayPrototype.cs, LenientBooleanPrototype.cs, 
1590         LenientDateConstructor.cs, LenientDatePrototype.cs, 
1591         LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs, 
1592         LenientFunctionPrototype.cs, LenientMathObject.cs, 
1593         LenientNumberPrototype.cs, LenientObjectPrototype.cs, 
1594         LenientRegExpPrototype.cs, LenientStringConstructor.cs, 
1595         LenientStringPrototype.cs, LenientVBArrayPrototype.cs, 
1596         MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs, 
1597         NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs, 
1598         NumericUnary.cs, ObjectPrototype.cs, Plus.cs, 
1599         PostOrPrefixOperator.cs, RangeErrorObject.cs, 
1600         ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs, 
1601         RegExpPrototype.cs, Relational.cs, ResInfo.cs, 
1602         ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs, 
1603         StackFrame.cs, StrictEquality.cs, StringPrototype.cs, 
1604         SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs, 
1605         TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs, 
1606         URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs, 
1607         VersionableAttribute.cs 
1608
1609         Now, I must fill in the blanks :-)
1610
1611
1612 2003-07-09  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1613         * jscript-lexer-parser.g: Added conditional_compilation_directive,
1614         which is the beginning of our support for conditional compilation
1615         statements and directives in our parser. Added
1616         cc_on_statement, and some lexer rules for getting the needed
1617         tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
1618         COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
1619
1620
1621 2003-07-03  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1622
1623         * jscript-lexer-parser.g: Changed the format of copyright notice.
1624
1625         This changes will allow the support
1626         for the grammar added by MS to EcmaScript (aka its JScript .Net),
1627         I'm still missing some, but they are on the way.
1628
1629         * jscript-lexer-parser.g: Deleted function_declaration, and
1630         added global_function_declaration and type_function_declaration.
1631         I decided  to make the grammar as strict as the MS docs mark,
1632         but there's a difference between what their docs says and what
1633         their compiler does. For this case I decided to follow the
1634         docs. A program like: 
1635                 private function F () 
1636                 {}
1637         according to the docs, would not be syntaticly correct. But the MS
1638         compiler, accepts the grammar construct and mark the error at
1639         semantic analysis phase. I followed the docs this time. 
1640
1641         * jscript-lexer-parser.g: Added debbuger_statement.
1642         * jscript-lexer-parser.g: Added import_statement.
1643         * jscript-lexer-parser.g: Added package_statement and package_member(s).
1644         * jscript-lexer-parser.g: Added super_statement.
1645         * jscript-lexer-parser.g: Added const_statement.
1646         * jscript-lexer-parser.g: Added class_statement,
1647         interfaces_list and class_members. 
1648
1649         * jscript-lexer-parser.g: Added interface_statement and
1650         interface_members.
1651
1652         * jscript-lexer-parser.g: Added enum_statement.
1653         * jscript-lexer-parser.g: Added static_statement. The rule for
1654         this syntatic construc is: static identifier { [body] }
1655         body does not get well specified in the docs. Must search wich
1656         are the possible values of it.
1657
1658         * jscript-lexer-parser.g: At variable_declaration, added
1659         support for explicit type declaration.
1660
1661         * jscript-lexer-parser.g: Added numeric_literal,
1662         DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1663
1664         * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1665
1666
1667 2003-06-09  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1668
1669
1670         * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1671         Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1672         FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
1673         With, 
1674         
1675         That method will be the driver that will allow classes
1676         that implement the Visitor interface do a walk through the AST's
1677         elements, in particular the Semantic Analizer and the Code
1678         Generator. Every class that inherits from AST will have a Visit
1679         method, that method will receive a Visitor and a object as
1680         parameters, the only thing that it'll do is letting the Visitor
1681         call the respective method VisitX, where X is the name of the
1682         currently visited class.
1683         
1684         * ASTList.cs:Added constructor, Add, Visit, ToString  methods.
1685
1686         * FunctionDeclaration.cs: Added constructor, Visit and ToString
1687         methods.
1688         
1689         * jscript-lexer-parser.g: Added a ASTList as a parameter to the
1690         program (the main entry of the parser). Also added as parameters: 
1691                 - An AST to source_element.
1692                 - A Statement to statement.
1693                 - A VariableStatement to variable_statement.
1694                 - A VariableStatement to variable_declaration_list.
1695                 - A FormalParamerList by formal_parameter_list.
1696                 - A ASTList by function_body.
1697         
1698         And now some rules return objects:
1699                 - A VariableDeclaration by variable_declaration.
1700                 - A Functiondeclaration by function_declaration.
1701
1702         * driver.cs: Added the construction of the AST of the EcmaScript
1703         program.
1704
1705         * Visitor.cs: Added this file. It's the visitor interface. 
1706
1707         * VariableDeclaration.cs: Added this class, it's the AST
1708         representation of a variable declaration.
1709
1710         * Statement.cs: Added this file. It's the logical representation
1711         of a Statement.
1712
1713         * VariableStatement.cs: Added this class. It's the AST
1714         representation of a chain of variable declarations.
1715         
1716         * FormalParameterList.cs: The function declaration needs to store
1717         its parameter, we will put them on this class.
1718
1719         * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
1720         implement the semantic analysis and code generation
1721         phases. SemanticAnalizer and CodeGenerator will implement the
1722         Visitor interface, they will walk a program's
1723         AST tree and do their respective work.
1724
1725         * IdentificationTable.cs: Added this class. The SymbolTable will be used
1726         by the SemanticAnalyzer in order to keep track of the variable
1727         declaration encountered, etc..
1728
1729         * SymbolTable.cs: A simple hashtable but for commodity i'll call
1730         it this way.
1731
1732         
1733 2003-05-03  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
1734
1735         * jscript-lexer-parser.g:
1736         - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
1737         MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
1738         ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
1739         SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
1740         BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
1741         - Changed INTERROGATION to CONDITIONAL.
1742         - Changed TRIANGLE to BITWISE_XOR.
1743         - Changed SLASH to DIVISION.
1744         - Changed PERCENT to REMAINDER.
1745         - Changed ADMIRATION to LOGICAL_NOT
1746         - Added BITWISE_NOT (~).
1747         - Added the INCREMENT and DECREMENT rules for
1748         left_hand_side_expression.
1749         - Increased lexer lookup from 2 to 4.
1750         - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
1751         BITWISE_AND, BITWISE_OR,
1752         - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
1753         REMAINDER, UNSIGNED_RIGHT_SHIFT.
1754         - Added the recursion rules for equality_expression.
1755         - Added the recursion rules for shift_expression.
1756         - Now we skip tabs.
1757         - The most important thing, added support for expressions like:
1758         sdf.[hgh], cool!
1759
1760 2003-04-20      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1761
1762         * driver.cs: 
1763         - Erased the Context class, it was used for the first
1764         test of the print_statement and Reflection.Emit. As I erased the
1765         Program, SourceElements, SourceElement from the ANTLR grammar (for
1766         the rework of the AST tied to the MS JScript public API), I erased
1767         some uses in here.
1768         - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1769         EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1770         EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1771         Emit.
1772
1773         * jscript-lexer-parser.g: 
1774         - Erased the references to the classes Program, SourceElements,
1775         SourceElement, Statement, FunctionDeclaration and erased
1776         print_statement rule. 
1777
1778         * JSCriptLexer.cs JScriptParser.cs and the other files generated
1779         by antlr, reflect changes from the grammar changes.
1780
1781 2003-04-19      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1782         * Added stubs for the classes:
1783         ASTList.cs 
1784         ActivationObject.cs 
1785         ActiveXObjectConstructor.cs 
1786         ArrayConstructor.cs 
1787         ArrayLiteral.cs 
1788         ArrayObject.cs 
1789         AssemblyCustomAttributeList.cs 
1790         BaseVsaEngine.cs 
1791         BinaryOp.cs 
1792         Binding.cs 
1793         Block.cs 
1794         BooleanConstructor.cs 
1795         BooleanObject.cs 
1796         Closure.cs 
1797         Context.cs 
1798         DateConstructor.cs 
1799         DateObject.cs 
1800         DebugBreak.cs 
1801         Empty.cs 
1802         EnumeratorConstructor.cs 
1803         EnumeratorObject.cs 
1804         ErrorConstructor.cs 
1805         ErrorObject.cs 
1806         Eval.cs 
1807         ForIn.cs 
1808         FunctionConstructor.cs 
1809         FunctionDeclaration.cs 
1810         FunctionExpression.cs 
1811         FunctionObject.cs 
1812         GlobalObject.cs 
1813         GlobalScope.cs 
1814         IActivationObject.cs 
1815         IRedirectOutput.cs 
1816         IVsaScriptScope.cs 
1817         Import.cs 
1818         JSBuiltIn.cs 
1819         JSField.cs 
1820         JSFunctionAttribute.cs 
1821         JSFunctionAttributeEnum.cs 
1822         JSLocalField.cs 
1823         JSObject.cs 
1824         JSToken.cs 
1825         JSVariableField.cs 
1826         LenientGlobalObject.cs 
1827         MathObject.cs 
1828         NumberConstructor.cs 
1829         NumberObject.cs 
1830         ObjectConstructor.cs 
1831         Package.cs 
1832         RegExpConstructor.cs 
1833         RegExpObject.cs 
1834         ScriptBlock.cs 
1835         ScriptFunction.cs 
1836         ScriptObject.cs 
1837         StringConstructor.cs 
1838         StringObject.cs 
1839         Throw.cs 
1840         Try.cs 
1841         UnaryOp.cs 
1842         VBArrayConstructor.cs 
1843         VsaEngine.cs 
1844         With.cs         
1845         
1846
1847 2003-04-11      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1848
1849         * jscript-lexer-parser.g:
1850         - Added rules for: continue_statement, break_statement,
1851         return_statement, throw statement (all of them do not ensure that
1852         no LineSeparator appears between the keyword on the left and the
1853         identifier, expression or semicolon on the right, that must be fixed).
1854         - Added single line comments rule.
1855
1856 2003-04-08      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1857
1858         * jscript-lexer-parser.g: Added syntatic rule for:
1859         - if_statement.
1860         - while and for-in subrules of iteration_statement.
1861         - Added array_literal - got tricky - I just could get the simplest rule going :)
1862         - Added elision.
1863
1864         
1865 2003-04-08      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1866
1867         * jscript-lexer-parser.g:
1868         - Syntatic rule for iteration_statement.
1869         - "do" subrule for it.
1870         - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
1871         "in") relational_expression | ) rule to relational_expression.
1872         -Added function_expression syntatic rule.
1873         - Added STRING_LITERAL to literal rules.
1874         - "Less/Greater or equal than" lexer rule.
1875
1876 2003-04-03      Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1877
1878         * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
1879
1880 2003-04-01    Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1881
1882         * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1883         
1884
1885 2003-03-30    Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1886
1887         * Added a README file. Explains the dependencies and build process.
1888
1889 2003-03-30   Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1890
1891         * Added this ChangeLog file.
1892         
1893         * ast.cs: Added this file. Contains the classes used for building
1894         the EcmaScript 's AST.
1895
1896         * JScript*: These are the files generated by antlr (the parser generator). 
1897
1898         * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
1899
1900         * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
1901         that will be moved to other file in the future.
1902
1903         * jscript-lexer-parser.g: The EcmaScript's antlr grammar.