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