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