1 2005-05-30 Cesar Lopez Nataren <cnataren@novell.com>
3 * Literal.cs: (RegExpLiteral.Emit): Take care of attributes. "g" is
4 global, "i" is case-insensitive and "m" is multi-line.
6 2005-05-19 Cesar Lopez Nataren <cnataren@novell.com>
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.
13 2005-05-18 Marek Safar <marek.safar@seznam.cz>
15 * JScriptCodeGenerator.cs: Stubbed.
17 * JScriptCodeProvider.cs: Implemented.
19 2005-05-17 Cesar Lopez Nataren <cnataren@novell.com>
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
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.
43 * Try.cs: open a scope indicating that's for a catch block.
45 2005-05-07 Cesar Lopez Nataren <cnataren@novell.com>
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
54 2005-05-06 Cesar Lopez Nataren <cnataren@novell.com>
56 * Binding.cs: add missing methods and fields.
58 2005-05-03 Cesar Lopez Nataren <cnataren@novell.com>
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.
72 2005-04-28 Cesar Lopez Nataren <cnataren@novell.com>
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
96 2005-04-18 Cesar Lopez Nataren <cnataren@novell.com>
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.
105 2005-04-15 Cesar Lopez Nataren <cnataren@novell.com>
107 * Statement.cs: make internal the builders.
108 * expression.cs: (Identifier.Emit) Take into account if its
109 binding is of type Catch.
111 2005-04-14 Cesar Lopez Nataren <cnataren@novell.com>
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.
117 * Eval.cs: Back to M.J.
119 * ast.cs: locals from abstract class Function is now an array of
120 objects not just AST's.
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.
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.
131 * TypeManager.cs: renamed IdentificationTable locals to
132 local_script_functions, AddLocal to AddLocalScriptFunction,
133 GetLocal to GetLocalScriptFunction. Added method CurrentLocals.
135 * IdentificationTable.cs: Method CurrentLocals now returns
136 an array of object's not AST's.
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'
148 2005-04-10 Cesar Lopez Nataren <cnataren@novell.com>
150 * StackTrace.cs: Back to M.J namespace.
152 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
154 * Literal.cs: fix the build and broke something else ;-).
156 2005-04-08 Cesar Lopez Nataren <cnataren@novell.com>
158 * Literal.cs: Implement the construction of regular expression literal.
159 * Parser.cs: Pass the proper parent to RegExpLiteral.
161 2005-03-30 Cesar Lopez Nataren <cnataren@novell.com>
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.
176 2005-03-29 Cesar Lopez Nataren <cnataren@novell.com>
178 * GlobalScope.cs: Set parent and engine in ctr. Return 'this' for
179 GetDefaultThisObject.
180 * ScriptObject.cs: Added protected 'parent' field of type
183 2005-03-16 Cesar Lopez Nataren <cnataren@novell.com>
185 * FunctionExpression.cs: Update to TypeManager new API.
187 * TypeManager.cs: Keep both MethodBuilder and LocalBuilder around.
189 * FunctionDeclaration.cs: In some contexts we need the
190 MethodBuilder and LocalBuilder, so we must keep both around.
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.
196 2005-02-28 Cesar Lopez Nataren <cnataren@novell.com>
198 * ForIn.cs: Initial implementation of ForIn stm.
200 2005-02-27 Cesar Lopez Nataren <cnataren@novell.com>
202 * VariableStatement.cs (PopulateContext): Do not add the symbol to
203 the context if already defined in current context.
205 * CodeGenerator.cs: Renamed VariableDefined to variable_defined_in_current_scope.
207 * TypeManager.cs: Reimplemented it, We use an IdentificationTable
208 instead of a simple Hashtable so we can handle scopes
209 properly. Cleaner api.
211 * VariableDeclaration.cs: Use new CodeGenerator api. (EmitDecl)
212 Add the builders to the TypeManager.
214 * Block.cs: Use new TypeManager api.
216 * FunctionDeclaration.cs: Use new TypeManager api. Take care of
217 scopes in the TypeManger on Emit.
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.
224 * expression.cs: Use new api from TypeManager, Add casts where neeeded.
226 This solves an infinite loop we were falling into when calling
227 IdentificationTable.CurrentLocals when repeated declarations where
228 inside function declarations.
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.
239 2005-02-22 Cesar Lopez Nataren <cnataren@novell.com>
241 * Block.cs: Report error JS5040. Reopened #72674, see last comment of it.
243 * CodeGenerator.cs: Added method VariableDefined.
245 * TypeManager.cs: Added method SetMethod.
247 * VariableDeclaration.cs (EmitDecl): Added logic to allow multiple
248 declarations of the same var. Fixes #72674.
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.
254 * FunctionDeclaration.cs: Added logic for allowing multiple
255 declaration of methods with the same name. Fixes #72674.
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.
261 2005-02-20 Cesar Lopez Nataren <cnataren@novell.com>
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.
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
278 2005-02-14 Cesar Lopez Nataren <cnataren@novell.com>
280 * Token.cs, TokenStream.cs, Parser.cs: make this classes internal.
282 * Context.cs: delete wrongly exposed ctr.
284 2005-02-10 Cesar Lopez Nataren <cnataren@novell.com>
286 * expression.cs: use InFuntion in proper places.
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.
293 2005-02-09 Cesar Lopez Nataren <cnataren@novell.com>
295 * expression.cs: Added method EmitStore and EmitLoad to Identifier
296 class. Implemented op= operators. Fixes 72393.
298 2005-02-08 Cesar Lopez Nataren <cnataren@novell.com>
300 * expression.cs (Identifier.Emit): Handle case where we are
301 assigning to a formal parameter. Fixes #72333.
303 2005-02-06 Cesar Lopez Nataren <cnataren@novell.com>
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
316 * CodeGenerator.cs: change signature of load_engine. Instead of a
317 AST a boolean. So we can call it with InFunction as parameter.
319 2005-02-05 Cesar Lopez Nataren <cnataren@novell.com>
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
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
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,
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.
360 2005-01-17 Cesar Lopez Nataren <cnataren@novell.com>
362 * CodeGenerator.cs: Added load_engine.
363 * expression.cs (emit_func_call), FunctionDeclaration.cs: Fix
364 computation of VsaEngine.
366 2005-01-11 Cesar Lopez Nataren <cnataren@novell.com>
368 * StringConstructor.cs: implement CreateInstance.
370 2005-01-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
372 * BooleanPrototype.cs: update to assert_type.
373 * SemanticAnalizer.cs: move BooleanPrototype.AssertType here, rename it to assert_type.
375 2005-01-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
377 * BooleanObject.cs: implement ctr's.
378 * BooleanPrototype.cs: back to M.J namespace. Implement contructor
379 property, toString and valueOf, add AssertType.
381 * Convert.cs: add ToString overload and implement.
383 * JSFieldInfo.cs, JSLocalField.cs: Add conditional NET_2_0 or BOOTSTRAP_NET_2_0 's
384 Mono_GetGenericFieldDefinition.
386 * StringObject.cs: add ctrs.
388 2005-01-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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
397 2004-12-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
399 * CodeGenerator.cs: add support for compiling not only from cwd.
401 2004-12-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
403 * expression.cs: emit code for null literal.
405 2004-12-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
407 * expression.cs: added StringConstructor case.
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
416 2004-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
418 * *Prototype.cs: return constructor.
420 2004-11-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
422 * GlobalObject.cs: return the different kinds of object's
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
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.
436 * MathObject.cs: implement its methods.
438 2004-11-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
440 * DateConstructor.cs: runtime support, ported parse method from Rhino.
442 2004-11-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
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.
454 * Relational.cs (Emit): fix typo, emit boxing to boolean.
456 2004-11-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
458 * NumericBinary.cs: implement EvaluateNumericBinary.
460 2004-11-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
467 2004-11-12 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
474 * Parser.cs, expression.cs: discriminate among =, +=, -=, etc. Add overload of
477 2004-11-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
479 * expression.cs (emit_late_call): Pop after Call or CallValue when
480 needed. (New.Emit) add emit_create_instance.
483 2004-11-08 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
485 * expression.cs (class New): add new operator support. Add
486 emit_args, implemented Emit.
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.
492 * expression.cs (emit_func_call): pop if function's return type is
493 non-void and has no effect.
495 2004-11-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
503 2004-10-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
505 * StringObject.cs: add value field
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
512 2004-10-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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
520 2004-10-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
522 * Parser.cs: set the operator properly.
524 2004-10-11 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
526 * GlobalObject.cs: ported encodeURI, encodeURIComponent,
527 decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode.
529 * expression.cs (Call.Emit): implement IsConstructorProperty.
531 2004-10-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
533 * expression.cs: added support for function calls. Handle case of
534 print where no args are supplied.
536 2004-10-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
546 2004-09-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
548 * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField.
550 * Parser.cs: use ToJSToken to set the operator properly.
551 * FunctionDeclaration.cs: delete spaces.
553 2004-09-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
555 * FunctionDeclaration.cs: check for parent being a ScriptBlock.
557 2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
586 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
598 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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
606 * LateBinding.cs: back to Microsoft.JScript namespace.
609 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
617 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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
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.
666 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
672 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
674 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
675 Mozilla/Rhino's parser.
677 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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).
692 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
708 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
716 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
722 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
724 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
726 * Statement.cs: Added code generation support for 'switch' statement.
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
733 * With.cs: code generation support for 'with' stm.
735 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
737 * Statement.cs: initial code generation of 'for'.
738 * jscript-lexer-parser.g: let's build for's ast.
740 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
748 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
754 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
756 * Literal.cs: emit the correct code for negative numbers.
757 * jscript-lexer-parser.g: set parent unary_expr.
759 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
761 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
762 * Statement.cs: Added code generation for while and do-while.
764 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
772 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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
780 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
788 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
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.
800 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
802 * expression.cs: added Modulo operator case.
804 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
806 * Convert.cs: added rule for string conversion.
808 * Plus.cs: added rule for string addition.
810 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
811 Emit (cases where there's no real operator).
813 * StringLiteral.cs: now implements Exp as can appear as a simple
814 exp in global code. Added check for Pop generation.
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.
822 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
823 AST, this handles the case where no postOrPrefixOp present; Unary
826 * FormalParameterList.cs: added get_element, retrieves nth element.
828 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
830 * ScriptStream.cs: let's print some messages.
832 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
834 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
836 * jscript-lexer-parser.g: keep track of return's parent.
837 * Statement.cs: added parent parameter to constructor.
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.
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.
847 * FormalParameterList.cs: added field pos to FormalParam, and set
848 it at FormalParameterList's Resolve stage.
850 * TODO: updated TODO.
852 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
854 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
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,
861 * VariableDeclaration.cs: updates needed because of EmitContext change.
863 * Statement.cs: added parent param to If constructor. Implement
864 Resolve and Emit for If statement.
866 * Relational.cs: Set parent. The boxing happens in the containing statement.
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.
876 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
877 current EmitContext's ILGenerator.
879 * Convert.cs: Do not throw the NotImplementedException anymore for
880 method ToBoolean, for now we always return false. This must get a
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.
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.
892 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
894 * Relational.cs: Initial generation of CIL for relational operators.
896 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
898 * jscript-lexer-parser.g: formal_param_list receives a parent too.
900 * SymbolTable.cs: added size and current_symbols properties.
902 * JSLocalField.cs: don't throw not ImplementedException from
903 constructor (same reason, testing purposes, must get implemented
906 * IdentificationTable.cs: added num_of_locals and current_locals properties.
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.
915 * FormalParameterList.cs: made FormalParam inherit from
916 AST. Implement the Emit for parameters, yeah!
918 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
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.
924 * Block.cs: renamed field, and implement the double pass for
925 nested function declarations code emittion, yeah!.
927 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
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.
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.
947 * Block.cs (Resolve): That check was not necessary.
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.
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 :-(
967 * driver.cs: deleted debug messages, added "Compilation Succeeded"
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.
977 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
979 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
981 * CodeGenerator.cs: small fixes to generate same things that ms.
983 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
985 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
987 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
989 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
991 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
993 * jscript-lexer-parser.g: keep track of parent reference for
994 IDENTIFIER, STRING_LITERAL.
996 * expression.cs: Added 'binding' field. Added 'parent' parameter
997 to constructor. Now we emit the proper code for the identifier.
999 * VariableStatement.cs: updated to field names instead of the old
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,
1007 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
1008 object instead of a boolean.
1010 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
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.
1016 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1018 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
1020 * VariableDeclaration.cs: now I handle initialization (ex. var x =
1021 2; or function f () { var x = 4; }) at global scope or at
1024 * Literal.cs: Added parent param to NumericLiteral constructor.
1026 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
1028 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1030 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
1032 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
1039 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
1045 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
1051 * jscript-lexer-parser.g: Now I keep track of the parent for most
1052 of the syntatic constructs. Fixed object_literal rule.
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
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
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.
1076 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1078 * expression.cs: Added new field to Call class, so it can handle more arguments.
1080 * StringLiteral.cs (Emit) : Load the string value.
1082 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
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
1089 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
1097 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1099 * expression.cs (Expression): implemented Emit.
1101 * expression.cs (Binary): Emit now creates a local for the
1102 different kinds of binary expressions (initial code for this).
1104 * ast.cs: Emit method now is abstract instead of virtual.
1106 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
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, :
1118 * FunctionDeclaration.cs: Check if values are not null first (at
1119 Resolve). Ignore code generation is at 'Global Code'.
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.
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.
1129 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
1131 * Visitor.cs: Deleted.
1133 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
1135 * FormalParameterList.cs: Now inherits from AST. Each of the
1136 formal parameters gets into the IdentificationTable at Resolve.
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.
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
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.
1151 * Relational.cs: Resolve recursively left and right.
1153 * SemanticAnalyser.cs: added flag for 'print statement'.
1155 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
1158 * driver.cs: Init the semantic analysis phase.
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.
1165 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
1167 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
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).
1173 * Literal.cs: Added NumericLiteral class.
1175 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
1177 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
1178 if inside a nested block.
1180 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
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!).
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.
1193 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
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
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.
1205 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
1206 a global declaration or inside a function declaration.
1208 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
1210 * FunctionObject.cs: Handle no parameters on functions.
1212 * jscript-lexer-parser.g: Allow functions without parameters.
1214 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
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.
1226 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
1228 * FormalParameterList.cs: Added FormalParam class. Change Add
1229 method to receive the id and the type annotation from function's parameters.
1231 * FunctionDeclaration.cs: Added code for initial function's
1232 definition code generation.
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.
1238 * IdentificationTable.cs: Added ToString method.
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.
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.
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.
1253 * VariableDeclaration.cs: Added InitValue property.
1255 * ast.cs: Added some comments and abstract method 'Resolve'.
1257 * jscript-lexer-parser.g: Added parsing support for formal
1258 parameters type annotations.
1260 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
1262 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
1265 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
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 ;-)
1277 * ScriptStream.cs: added WriteLine.
1279 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
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).
1296 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
1298 * statement.cs: added Return class.
1300 * Throw.cs: Added expression field, constructor and ToString.
1302 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
1305 * With.cs: added constructor and ToString. Back to the non-tmp
1308 * jscript-parser-lexer.g: allow with_stm tree building.
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
1314 * statement.cs: switched to internal 'If' class. Added Continue
1315 class. Added Break class.
1317 * jscript-lexer-parser.g: build tree for function decl or expr.
1319 * FunctionDeclaration.cs: added internal constructor.
1321 * FunctionExpression.cs: added internal constructor.
1323 * FunctionObject.cs: added internal constructor and ToString method.
1325 * jscript-lexer-parser.g: added building tree for if_stm.
1326 * Statement.cs: Added if class for 'if' statement.
1329 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
1331 * VariableDeclaration.cs: added the initializer to ToString.
1333 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
1336 * Block.cs, Equality.cs, Relational.cs: modified ToString
1338 * Equality.cs, Relational.cs, StringLiteral.cs,
1339 VariableDeclaration.cs: Added constructor
1341 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
1342 name convetion style to mono style.
1344 * UnaryOp.cs: added operator and operand fields.
1346 * VariableDeclaration.cs: chenged field name from assignExp to val.
1348 * BinaryOp.cs: Made "internal" the attributes, added the two
1351 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
1353 * driver.cs: Dump the string representation of the parsed exps.
1355 * Literal.cs: added BooleanLiteral
1357 * Relational.cs: added constructor, ToString,
1359 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
1361 * README: added some info about hacking the grammar
1363 * JSparser.cs: Updated the constructor to not receiving params.
1365 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
1366 JScriptParserTokenTypes.txt: update of antlr generated files from
1369 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
1370 can parse a little bit more useful programs like:
1372 function factorial (i)
1379 k = factorial (i - 1);
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.
1398 2003-09-29 <cesar@ciencias.unam.mx>
1400 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
1402 * Added VsaItem.cs, implements IVsaItem.
1404 2003-09-28 <cesar@ciencias.unam.mx>
1406 * VsaItems.cs: Check that no name is repeated (this was docs fault
1407 :-)). This is the beauty of testing.
1409 * Add VsaItems.cs, implements IVsaItems.
1411 2003-09-22 <cesar@ciencias.unam.mx>
1413 * DocumentContext.cs: changed constructor from internal to public,
1414 this a kind of hack ;), but we can build mjs.exe with that change.
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:
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.
1445 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
1447 2003-09-21 <cesar@ciencias.unam.mx>
1449 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
1451 2003-09-20 <cesar@ciencias.unam.mx>
1453 * jscript-lexer-parser.g: We are little bit closer to the spec on
1454 StringLiteral definition.
1456 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
1458 * jscript-lexer-parser.g: Build ast for FunctionExpression.
1460 * JSObject.cs: we don't throw NotImplementedException anymore,
1461 this let us use FunctionExpression to build the ast.
1463 * FunctionExpression.cs: Added a FunctionObject as field, a
1464 default constructor.
1466 * FunctionObject.cs: Added default constructor.
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.
1474 * driver.cs: Now we are using the Microsoft.JScript public API
1475 functions to load the lexer and parser.
1477 * ScriptBlock.cs,Block.cs: Added ToString function.
1479 2003-09-20 <cesar@ciencias.unam.mx>
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.
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
1497 * jscript-lexer-parser.g: updated the grammar to build the program
1498 representation based on ScriptBlock.
1500 2003-09-19 <cesar@ciencias.unam.mx>
1502 * JSToken.cs: public API compliance.
1504 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
1514 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1515 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
1517 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1519 * jscript-lexer-parser.g: Changed the namespace to
1520 Microsoft.JScript.Tmp.
1522 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
1524 * jscript-lexer-parser.g: Got the name of a
1525 global_function_declaration and also its return type if
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.
1532 * jscript-lexer-parser.g: Fixed the enum_statement to accept
1533 empty enum declarations.
1535 * jscript-lexer-parser.g: Got the type of a
1536 veriable_declaration.
1538 * jscript-lexer-parser.g: Initial construction of AST for
1539 primary_expression (in particular literal).
1542 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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
1551 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1552 * Statement.cs: Forgot to include it on last commit.
1554 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
1565 * Changed from public to internal Visit function at some
1568 * Package.cs: Added Name and Members fields.
1570 * SemanticAnalizer.cs: Added methods VisitPrint and
1573 * VariableDeclaration.cs: Added Type field.
1575 * Visitor.cs: Changed from public to internal. Added
1576 VisitPrint and VisitStringLiteral methods.
1578 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
1579 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
1584 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1586 * Added CmdLineError.cs and JSError.cs, last night I forgot to
1589 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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
1621 Now, I must fill in the blanks :-)
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.
1633 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1635 * jscript-lexer-parser.g: Changed the format of copyright notice.
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.
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 ()
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.
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.
1661 * jscript-lexer-parser.g: Added interface_statement and
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.
1670 * jscript-lexer-parser.g: At variable_declaration, added
1671 support for explicit type declaration.
1673 * jscript-lexer-parser.g: Added numeric_literal,
1674 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1676 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1679 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1682 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1683 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1684 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
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.
1696 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
1698 * FunctionDeclaration.cs: Added constructor, Visit and ToString
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.
1710 And now some rules return objects:
1711 - A VariableDeclaration by variable_declaration.
1712 - A Functiondeclaration by function_declaration.
1714 * driver.cs: Added the construction of the AST of the EcmaScript
1717 * Visitor.cs: Added this file. It's the visitor interface.
1719 * VariableDeclaration.cs: Added this class, it's the AST
1720 representation of a variable declaration.
1722 * Statement.cs: Added this file. It's the logical representation
1725 * VariableStatement.cs: Added this class. It's the AST
1726 representation of a chain of variable declarations.
1728 * FormalParameterList.cs: The function declaration needs to store
1729 its parameter, we will put them on this class.
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.
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..
1741 * SymbolTable.cs: A simple hashtable but for commodity i'll call
1745 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
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.
1769 - The most important thing, added support for expressions like:
1772 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
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
1780 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1781 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1782 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1785 * jscript-lexer-parser.g:
1786 - Erased the references to the classes Program, SourceElements,
1787 SourceElement, Statement, FunctionDeclaration and erased
1788 print_statement rule.
1790 * JSCriptLexer.cs JScriptParser.cs and the other files generated
1791 by antlr, reflect changes from the grammar changes.
1793 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1794 * Added stubs for the classes:
1797 ActiveXObjectConstructor.cs
1801 AssemblyCustomAttributeList.cs
1806 BooleanConstructor.cs
1814 EnumeratorConstructor.cs
1820 FunctionConstructor.cs
1821 FunctionDeclaration.cs
1822 FunctionExpression.cs
1826 IActivationObject.cs
1832 JSFunctionAttribute.cs
1833 JSFunctionAttributeEnum.cs
1838 LenientGlobalObject.cs
1840 NumberConstructor.cs
1842 ObjectConstructor.cs
1844 RegExpConstructor.cs
1849 StringConstructor.cs
1854 VBArrayConstructor.cs
1859 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
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.
1868 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1870 * jscript-lexer-parser.g: Added syntatic rule for:
1872 - while and for-in subrules of iteration_statement.
1873 - Added array_literal - got tricky - I just could get the simplest rule going :)
1877 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
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.
1888 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
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.
1892 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1894 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1897 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1899 * Added a README file. Explains the dependencies and build process.
1901 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1903 * Added this ChangeLog file.
1905 * ast.cs: Added this file. Contains the classes used for building
1906 the EcmaScript 's AST.
1908 * JScript*: These are the files generated by antlr (the parser generator).
1910 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
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.
1915 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.