1 2005-02-10 Cesar Lopez Nataren <cnataren@novell.com>
3 * expression.cs: use InFuntion in proper places.
5 * Parser.cs: Add parameter that indicates if it's a prefix
6 operator. When building the MemberExprTail set to proper parent.
7 * PostOrPrefixOperator.cs: Partial implementation of ++ and --,
8 prefix and suffix, we assume that the operand is a variable.
10 2005-02-09 Cesar Lopez Nataren <cnataren@novell.com>
12 * expression.cs: Added method EmitStore and EmitLoad to Identifier
13 class. Implemented op= operators. Fixes 72393.
15 2005-02-08 Cesar Lopez Nataren <cnataren@novell.com>
17 * expression.cs (Identifier.Emit): Handle case where we are
18 assigning to a formal parameter. Fixes #72333.
20 2005-02-06 Cesar Lopez Nataren <cnataren@novell.com>
22 * expression.cs: (load_script_func) Load localbuilder in an
23 invocation when needed, this let us have higher order functions,
24 which is lovely (Fixes #71129). Update calls to load_engine to new signature.
25 * FunctionDeclaration.cs: Add LocalBuilder to TypeManager.locals
26 * Statement.cs: Changed ctr to Init, so we can track correctly the
27 parent hierarchy when building the ast of the program.
28 * TypeManager.cs: Added field locals. Factored code for
29 handling the tables. Added enums ManagedType and Operation.
30 * Parser.cs: Track correctly the parent of return.
31 * ast.cs (class Function): add ScriptBlock as possible parent of a
33 * CodeGenerator.cs: change signature of load_engine. Instead of a
34 AST a boolean. So we can call it with InFunction as parameter.
36 2005-02-05 Cesar Lopez Nataren <cnataren@novell.com>
38 * expression.cs: rework the late binding algorithm, we directly
39 call an object's method if it's a static method of it. Added field
40 late_bind, properties AccessField and Binding, renamed emit_access
41 to emit_array_access to class Binary. Added fields params_info,
42 late_bind and var_args to Class Args; also methods has_var_args,
43 force_strong_type, reworked its Emit code, we take care of methods
44 which have variable number of arguments, take care of needed
45 conversions and boxing when the call has specific strong types as
46 formal parameters. Added method IsPrint and property Parameters to
48 * IdentificationTable.cs: Better implementation of jscript's
49 environments semantics. Added classes Symbol and Binder.
50 * SymbolTable.cs: Nuked.
51 * Block.cs: Fix the semantic of semantic analysis and code
52 generatipo process, we now allow forward declarations of variables
54 * FunctionDeclaration.cs: Added default ctr and Init method. Fix
55 the semantics of the Resolve and Emit process, we can have forward
56 declaration of variables and functions. Fix order in which
57 JSLocalField's get build.
58 * FunctionExpression.cs: Fix order in which JSLocalField's get build.
59 * VariableStatement.cs: Added methods EmitVariableDecls and PopulateContext.
60 * VariableDeclaration.cs: Added method EmitDecl. Delay the Resolve
61 and Emit process until the second phase.
62 * Statement.cs: Resolve process of For class take care of
63 VariableStatements for populating the environment in advance.
64 * TypeManager.cs: Make GetMethod return a MethodBuilder.
65 * ast.cs: Added field locals, property NumOfArgs, method GetName
66 to abstract class Function.
67 * SemanticAnalyser.cs: unified global environment and the stack of
68 contexts. Added field global_obj, adapt methods to new
69 IdentificationTable api. Delete method ObjectSystemContains. Added
70 method contains, is_js_object, object_contains_method, map_to_ctr,
72 * Try.cs: Update to new IdentificationTable api.
73 * ScriptObject.cs, JSPropertyInfo.cs, FormalParameterList.cs,
74 JSFieldInfo.cs, JSMethodInfo.cs, JSLocalField.cs,
75 ScriptFunction.cs: use full namespace name for Binder.
77 2005-01-17 Cesar Lopez Nataren <cnataren@novell.com>
79 * CodeGenerator.cs: Added load_engine.
80 * expression.cs (emit_func_call), FunctionDeclaration.cs: Fix
81 computation of VsaEngine.
83 2005-01-11 Cesar Lopez Nataren <cnataren@novell.com>
85 * StringConstructor.cs: implement CreateInstance.
87 2005-01-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
89 * BooleanPrototype.cs: update to assert_type.
90 * SemanticAnalizer.cs: move BooleanPrototype.AssertType here, rename it to assert_type.
92 2005-01-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
94 * BooleanObject.cs: implement ctr's.
95 * BooleanPrototype.cs: back to M.J namespace. Implement contructor
96 property, toString and valueOf, add AssertType.
98 * Convert.cs: add ToString overload and implement.
100 * JSFieldInfo.cs, JSLocalField.cs: Add conditional NET_2_0 or BOOTSTRAP_NET_2_0 's
101 Mono_GetGenericFieldDefinition.
103 * StringObject.cs: add ctrs.
105 2005-01-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
107 * ObjectPrototype.cs: Add internal ctr. Implement hasOwnProperty.
108 * ObjectConstructor.cs: implemented CreateInstance.
109 * expression.cs (emit_create_instance): add Boolean case.
110 * Try.cs, Statement.cs (EmitStms), Literal.cs
111 (ObjectLiteralItem.Emit), CodeGenerator.cs (fall_false): delete
114 2004-12-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
116 * CodeGenerator.cs: add support for compiling not only from cwd.
118 2004-12-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
120 * expression.cs: emit code for null literal.
122 2004-12-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
124 * expression.cs: added StringConstructor case.
126 * MemberInfoList.cs: added internal classes Node, ListIter,
127 ChainHash and implement MemberInfoList.
128 * JSObject.cs: implement AddField, AddProperty, AddMethod,
129 GetMembers, RemoveMember, GetEnumerator, add ChainHash's ext
133 2004-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
135 * *Prototype.cs: return constructor.
137 2004-11-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
139 * GlobalObject.cs: return the different kinds of object's
141 * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
142 NumberConstructor.cs, VBArrayConstructor.cs,
143 FunctionConstructor.cs, EnumeratorConstructor.cs,
144 BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs,
145 ActiveXObjectConstructor.cs : added default constructor and static
147 * ErrorConstructor.cs: added default and discriminatory ctrs. Let
148 us know which type of error we are.
149 * DateObject.cs: add field that hold the millisecond representation of date.
150 * JSError.cs, JScriptException.cs: back to Microsoft.JScript namespace.
151 * DatePrototype.cs: add default ctr.
153 * MathObject.cs: implement its methods.
155 2004-11-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
157 * DateConstructor.cs: runtime support, ported parse method from Rhino.
159 2004-11-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
161 * CodeGenerator.cs: (ff_emit_relational) receive a full
162 EmitContext as parameter. Added
163 ff_emit_equality_cond. (fall_false) take where of the case where
164 an expression is received.
166 * Parser.cs: use ToJSToken for building the Relational
167 object. Map relational Token's to JSToken's.
168 * expression.cs: Added Size property to class
169 Expression. (emit_create_instance): Added Number code generation.
171 * Relational.cs (Emit): fix typo, emit boxing to boolean.
173 2004-11-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
175 * NumericBinary.cs: implement EvaluateNumericBinary.
177 2004-11-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
179 * CodeGenerator.cs: factor code for fall_true/fall_false (add
180 emit_default_case, ft_binary_recursion, ft_emit_equality,
181 ff_emit_relational, ff_binary_recursion). Fix
182 trouble with logical ops code generation.
184 2004-11-12 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
186 * TypeOf.cs, Plus.cs, Equality.cs: implementation of
187 JScriptTypeOf, EvaluatePlus, EvaluateEquality.
188 * Convert.cs (ToString): use the IConvertible/TypeCode approach
189 for convertions. Add GetTypeCode.
191 * Parser.cs, expression.cs: discriminate among =, +=, -=, etc. Add overload of
194 2004-11-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
196 * expression.cs (emit_late_call): Pop after Call or CallValue when
197 needed. (New.Emit) add emit_create_instance.
200 2004-11-08 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
202 * expression.cs (class New): add new operator support. Add
203 emit_args, implemented Emit.
205 * expression.cs: emit unary operator code.
206 * TypeOf.cs: back to Microsoft.JScript namespace. fix typo.
207 * Literal.cs: constrain more the case of negative numeric literal.
209 * expression.cs (emit_func_call): pop if function's return type is
210 non-void and has no effect.
212 2004-11-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
214 * BinaryOp.cs: added constructor for instantiating derived classes.
215 * BitwiseBinary.cs, Equality.cs, In.cs, InstanceOf.cs,
216 NumericBinary.cs, Plus.cs, Relational.cs, StrictEquality.cs,
217 expression.cs (classes Binary, Assign): use inherited constructor.
218 * BitwiseBinary.cs, Equality.cs: deleted public constructor which carried the context.
220 2004-10-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
222 * StringObject.cs: add value field
224 * expression.cs: implement LateBinding. Added methods:
225 emit_late_binding, init_late_binding, emit_late_get_or_set,
226 get_global_scope_or_this, setup_late_call_args, load_script_func, emit_late_call
227 * Convert.cs: implement CheckIfDoubleIsInteger and CheckIfSingleIsInteger
229 2004-10-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
231 * ast.cs (Function): added method emit_return_local_field, if
232 there's a return stm inside a function we must allocate a
233 JSLocalField indicating the return type of the function.
234 * FunctionDeclaration.cs, FunctionExpression.cs: generate the
235 extra JSLocalField if needed
237 2004-10-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
239 * Parser.cs: set the operator properly.
241 2004-10-11 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
243 * GlobalObject.cs: ported encodeURI, encodeURIComponent,
244 decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode.
246 * expression.cs (Call.Emit): implement IsConstructorProperty.
248 2004-10-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
250 * expression.cs: added support for function calls. Handle case of
251 print where no args are supplied.
253 2004-10-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
255 * ast.cs: added GetContainerFunction property.
256 * Statement.cs: added class NotVoidReturnEventArgs and delegate
257 NotVoidReturnEventHandler, throw an event in case we find a
258 return, the enclosing function object takes care of changing the
259 return type of the function.
260 * FunctionDeclaration.cs, FunctionExpression.cs: take care of
261 return's inside functions.
263 2004-09-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
265 * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField.
267 * Parser.cs: use ToJSToken to set the operator properly.
268 * FunctionDeclaration.cs: delete spaces.
270 2004-09-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
272 * FunctionDeclaration.cs: check for parent being a ScriptBlock.
274 2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
276 * expression.cs: added semantic analysis for accessing fields on
277 class Binary. Semantic Analysis for Calls it takes care of
278 constructors and methods, added invocation code for built in
279 methods. Added interface IAccesible that let us resolve the '.'
280 operator. Class Args handles missing or surplus arguments. Added
281 class BuiltIn which will take care of all builtins of ECMAScript.
282 * ast.cs: added check for parent equal to ScriptBlock.
283 * SymbolTable.cs: added method Remove.
284 * Statement.cs: Added abstract class Jump of which Continue and
285 Break inherit, checks the label stuff. Added checks for Label
286 stuff to Continue and Break classes. Added method Init for
287 DoWhile. Fixes for loops statements in order to be able for have
288 nested loops. Initial support for Label statements.
289 * SemanticAnalizer.cs: added hash global_env and
290 IdentificationTable label_set for keeping track of global methods and
291 label sets. Added static constructor, method BuildGlobalEnv,
292 ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel,
293 GetLabel, RemoveLabel.
294 * Relational.cs: added code generation for ops instanceof and
295 in. Fixes for usual relational ops.
296 * Parser.cs:fixes to keep track of the inheritance chain.
297 * MathObject.cs: added internal constructor.
298 * JSFunctionAttribute.cs: added fields value and built_in_function
299 so we can decide when a method is really a built in.
300 * IdentificationTable.cs: added method Remove.
301 * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression.
303 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
305 * expression.cs: made Binary is IAssignable, added fields assign
306 and right_side, added method ResolveAssign (which now receives an
307 extra parameter, being the right side of the assigment). Take care of being
308 inside a function for array indexing. Take care of lvalue case
309 too. Assign.Emit just calls left.Emit since left knows everything
310 about the right side of the assigment after Resolve process.
311 * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
312 * BinaryOp.cs: renamed current_op to op as with the new
313 parser we no longer need to keep track of the old_op.
315 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
317 * expression.cs: do not pass the operand as a parameter to the
318 constructor as it gets after the parent gets constructed, same
319 with binary. Added code generation for array index access.
320 * Parser.cs: added ToJStoken which converts Token to JSToken,
321 factored the code for creation the Unary nodes. Take care of
323 * LateBinding.cs: back to Microsoft.JScript namespace.
326 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
328 * Parser.cs: pass the skip_count to ArrayLiteral constructor.
329 * Missing.cs: back to Microsoft.JScript namespace.
330 * ArrayLiteral.cs: added field skip_count, it tells us if this is
331 a spaced-arrayliteral, in which case we add a null value in the
332 list, added null check in the resolve and code generation process.
334 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
336 * expression.cs: added interface ICallable and and function AddArg
337 to class Call. Added class New.
338 * driver.cs: made it use the new lexer and parser.
339 * ast.cs: added field line_number, added property InFunction,
340 added class Function that factores all the code shared between
341 FunctionDeclaration and FunctionExpression.
342 * With.cs: constructor receives line number.
343 * VariableStatement.cs: constructor receives line number.
344 * VariableDeclaration.cs: Added check for parent being
345 FunctionDeclaration and FunctionExpression.
346 * Try.cs: Moved the code that used to take care of the catch to
347 Catch class. Constructor receives forming elements and line
348 number. Removed mangle_id.
349 * Throw.cs: constructor receives line number.
350 * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed
351 identifier to label in Continue and Break class, its constructor now
352 receives the label and line number. For class, constructor
353 receives its forming parts. Switch class, constructor receives
354 line number, added function AddClause and AddStm. Added class
355 Catch. Added class Labelled.
356 * SemanticAnalyser.cs: Added field anon_method_counter, properties
357 NextAnonymousMethod and CurrentAnonymousMethod.
358 * Parser.cs: function ArgumentList receives a ICallable list
359 instead of a AST. Now we add the arguments of a callable. Build
361 * Literal.cs: added constructor for 'this' literal and
362 ObjectLiteral constructor. Added RegExpLiteral class, will take
363 care of regular expressions semantic analysis and code generation.
364 * JSScanner.cs: use no more the antlr based lexer. Fix typo.
365 * JSParser.cs: make it use the new port of Rhino's Parser.
366 * FunctionObject.cs: Added constructor that receives the function name.
367 * FunctionExpression.cs: made it inherit from Function class. Added
368 constructor. Factored the code that used to set the prefix to
369 Function.set_prefix (it's shared with FunctionDeclaration). Added
370 fields local_script_func and field. Implemented Resolve and Emit
371 (now we can do: var x = function (this, method, is, anonymous) {... };).
372 * FunctionDeclaration.cs: made it inherit from Function class in
373 order to share code with FunctionExpression. Added new
374 constructor. Moved the code that used to built the prefix to
375 Function inside function set_prefix. When building the closure
376 added check for setting the type of a FunctionExpression. Moved
377 set_function_type and set_custom_attr to class Function.
378 * ForIn.cs: added constructor and fields lhs, obj and body.
379 * Block.cs: added default constructor and line number based
380 constructor. Check for elems not being null before adding.
381 * ArrayLiteral.cs: set elements in constructor.
383 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
385 * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
386 building the other block was not needed. Build the ast's for the
387 expressions and statements, keep track of the parent relationship.
389 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
391 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
392 Mozilla/Rhino's parser.
394 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
396 * jscript-lexer-parser.g: added ast building for object_literal,
397 it's disabled for now while I fix the "block Vs object_literal"
398 non-determinism problem on the parser. Added rule for
399 array_literal. Build PropertyName ast build.
400 * Literal.cs: fixed the negative numbers code generation (we must
401 optimize this). Added initial ObjectLiteral's class, code generation and
402 Resolve process. Added class ObjectLiteralItem and PropertyName.
403 * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
404 elisions we keep track of the "real" size here. Added constructor. Added initial
405 Resolve and Emit code.
406 * ASTList.cs: added Size property.
407 * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
409 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
411 * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
412 break and continue in order to jump to the desired place. Added
413 check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
414 * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
415 need to jump if the expression evaluates to true. Continue class,
416 replaced ParentIsItrStm with InLoop, emit jump to correct
417 place. Break class, implemented Resolve; deleted
418 ParentIsCorrect. DoWhile, While classes, set LoopBegin and
419 LoopEnd. While class, set LoopBegin and LoopEnd.
420 * ast.cs: Added InLoop and InSwitch.
421 * jscript-lexer-parser.g: pass parent to break_stm. Added block as
422 a statement. Temporarily disabled object_literal in order to test
423 the block structure and continue and break statements.
425 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
427 * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
428 property. Added initial pieces for Break's Resolve. Fixed bug that
429 did not let Emit the code for case clauses that came after the
430 default clause (we match the jsc behavior).
431 * jscript-lexer-parser.g: set parent of switch's clauses.
433 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
435 * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
436 * jscript-lexer-parser.g: set parent hierarchy for continue
437 statement. Set to correct parent in iteration_stm.
439 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
441 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
443 * Statement.cs: Added code generation support for 'switch' statement.
445 * jscript-lexer-parser.g: added 'using' for
446 System.Collections. Allow 'switch' statement building of its
447 ast. Added parent parameter to constructor of With. Build
450 * With.cs: code generation support for 'with' stm.
452 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
454 * Statement.cs: initial code generation of 'for'.
455 * jscript-lexer-parser.g: let's build for's ast.
457 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
459 * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
460 * expression.cs: handle Try case for field or local vars allocation.
461 * Try.cs: implemented Emit.
462 * Throw.cs: implemented code generation.
463 * FunctionDeclaration.cs: cache some values.
465 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
467 * FunctionDeclaration.cs: let's make function name formation
468 (get_name ()) a little bit less dumb. We cache the prefix now so
469 we don't have to recalculate it everytime.
471 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
473 * Literal.cs: emit the correct code for negative numbers.
474 * jscript-lexer-parser.g: set parent unary_expr.
476 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
478 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
479 * Statement.cs: Added code generation for while and do-while.
481 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
483 * Statement.cs (class if): reimplemented Emit based on fall_false.
484 * Equality.cs: added code generation for != and emit jumping code
485 only in the case we are at a global expression not statement.
486 * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
487 boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
489 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
491 * expression.cs (Binary.Emit): treat boolean operator
492 specially. Added emit_jumping_code.
493 * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
494 fall_false, which will express all boolean expressions and control
497 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
499 * Equality.cs: Moved the Emit and Resolve code here.
500 * jscript-lexer-parser.g: Build a Equality object instead of a
501 Binary object for equality_expr.
502 * expression.cs: moved equality oeprators (resolve and IL gen) to
503 Equality.Emit and Equality.Resolve.
505 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
507 * expression.cs: Added shift operators IL emit.
508 * BitwiseBinary.cs: added constructor for building it according to
509 JSToken enum. return a new object on EvaluateBitwiseBinary (this
510 needs a real implementation).
511 * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
513 * Statement.cs: added stub for While and DoWhile ast
514 representation (reworking my Emit code).
515 * jscript-parser-lexer.g: allow iteration statement ast build.
517 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
519 * expression.cs: added Modulo operator case.
521 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
523 * Convert.cs: added rule for string conversion.
525 * Plus.cs: added rule for string addition.
527 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
528 Emit (cases where there's no real operator).
530 * StringLiteral.cs: now implements Exp as can appear as a simple
531 exp in global code. Added check for Pop generation.
533 * expression.cs: added IL generation code for print func call.
534 Args class added get_element, Size and made Resolve behave as the
535 others (collect the differents Resolve's return values from each
536 of the arguments). Expression class, added default Resolve call
537 for non-Exp implementers.
539 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
540 AST, this handles the case where no postOrPrefixOp present; Unary
543 * FormalParameterList.cs: added get_element, retrieves nth element.
545 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
547 * ScriptStream.cs: let's print some messages.
549 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
551 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
553 * jscript-lexer-parser.g: keep track of return's parent.
554 * Statement.cs: added parent parameter to constructor.
556 * expression.cs: refactored Emit code from Identifier, now we take
557 care of function's paramenter references. First attack to function
558 calls, check if Resolve from Call succeed.
560 * VariableDeclaration.cs: Deleted Decl class, field_info and
561 local_builder fields were being used only by VariableDeclaration,
562 I'll keep them there.
564 * FormalParameterList.cs: added field pos to FormalParam, and set
565 it at FormalParameterList's Resolve stage.
567 * TODO: updated TODO.
569 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
571 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
573 * expression.cs: At class Conditional renamed fields. Class
574 Expression inherits from Exp as we must keep track if we must pop
575 the last value (this is for the comma operator), track the parent,
576 at Resolve we take care of the last value of the expression,
578 * VariableDeclaration.cs: updates needed because of EmitContext change.
580 * Statement.cs: added parent param to If constructor. Implement
581 Resolve and Emit for If statement.
583 * Relational.cs: Set parent. The boxing happens in the containing statement.
585 * FunctionDeclaration.cs: Added func_type field, will be used to determine the
586 type of the function we are generating (global function, method
587 from a class, etc) and attach to it the correct custom
588 attribute. Simplified the code for nested functions:
589 refactored the code so no code duplication is involved, now we
590 have only one function that retrieves the name of the function,
591 now create a new EmitContext for the body of the method.
593 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
594 current EmitContext's ILGenerator.
596 * Convert.cs: Do not throw the NotImplementedException anymore for
597 method ToBoolean, for now we always return false. This must get a
600 * CodeGenerator.cs: Deleted one of ILGenerator fields
601 from EmitContext, suffices using only one (more notes about the
602 change on the Functiondeclaration entry). Imitate jsc behavior for
603 compiled files names, aggregate the exe or dll extension after last dot.
605 * Block.cs: In order to implement the comma operator (i.e., expression,
606 assign_exp), we must track if our expressions are at a global
607 scope, in which case we must pop the last result too.
609 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
611 * Relational.cs: Initial generation of CIL for relational operators.
613 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
615 * jscript-lexer-parser.g: formal_param_list receives a parent too.
617 * SymbolTable.cs: added size and current_symbols properties.
619 * JSLocalField.cs: don't throw not ImplementedException from
620 constructor (same reason, testing purposes, must get implemented
623 * IdentificationTable.cs: added num_of_locals and current_locals properties.
625 * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
626 as fields. Not throw NotImplementedException for
627 JScriptFunctionDeclaration (testing purposes, must get implemeted
628 for real). Let's build our function closures! Added functions:
629 build_closure and build_closure_nested, build_local_fields. Keep
630 track of current parameters and locals defs.
632 * FormalParameterList.cs: made FormalParam inherit from
633 AST. Implement the Emit for parameters, yeah!
635 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
637 * Closure.cs: do not throw the exception (this allow me to run the
638 tests at mcs/jtests and check that at least i'm not generating
639 invalid CIL). Be aware that this must be really implemented.
641 * Block.cs: renamed field, and implement the double pass for
642 nested function declarations code emittion, yeah!.
644 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
646 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
647 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
648 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
649 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
650 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
652 * UnaryOp.cs: inherit from Exp now.
653 * Plus.cs: Don't throw the exception when calling constructor, let
654 it build the default handler. Return a new object when calling
655 EvaluatePlus until properly implemented.
657 * NumericUnary.cs: added new Resolve.
658 * NumericBinary.cs: assign operator val at ctr. Return a new
659 object when calling EvaluateNumericBinary until properly
660 implemented. Added Resolve.
661 * Equality.cs: added ctr and return false for EvaluateEquality
662 until properly implemented. Added Resolve's functions.
664 * Block.cs (Resolve): That check was not necessary.
666 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
667 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
668 BinaryOp and UnaryOp, and this from Exp.
669 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
670 * jscript-lexer-parser.g: deleted debugging messages. Create a
671 Assign object instance of a simple Binary obj. Same case for Equality.
673 * expression.cs: added Exp abstract class. Classes that are ast of
674 language constructions that can appear as global expressions that
675 get evaluated and then the result is discarded inherit from this
676 new class. This let meee keep track of things that must get Popped
677 or can even avoid the evaluation of it. Wrote real Resolve method
678 for classes: Unary, Binary.
679 Implemted Emit method for some binary operations (+, -, / and *),
680 for other operators some more code is still missing.
681 Identifier: handle assignment cases and global exp cases.
682 Added class Assign (compisite assignment still missing tough :-(
684 * driver.cs: deleted debug messages, added "Compilation Succeeded"
686 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
687 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
688 Exp and handle the case for global expressions that must be popped
689 after evaluation. no more invalid IL being generated! yeah!
690 * Block.cs: wrote real Resolve method, erased debug messages.
691 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
692 * BinaryOp.cs, Conditional: now inherits from Exp.
694 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
696 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
698 * CodeGenerator.cs: small fixes to generate same things that ms.
700 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
702 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
704 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
706 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
708 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
710 * jscript-lexer-parser.g: keep track of parent reference for
711 IDENTIFIER, STRING_LITERAL.
713 * expression.cs: Added 'binding' field. Added 'parent' parameter
714 to constructor. Now we emit the proper code for the identifier.
716 * VariableStatement.cs: updated to field names instead of the old
719 * VariableDeclaration.cs: Added class Decl, it constains the
720 references to the static field or LocalBuilder that are created
721 when a declaration is emitted. Deleted unuseful properties (Id,
724 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
725 object instead of a boolean.
727 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
729 * IdentificationTable.cs: Deleted Retrieve method. Contains method
730 now return an object instead of a boolean, that reference is the
731 binding associated with the identifier being searched.
733 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
735 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
737 * VariableDeclaration.cs: now I handle initialization (ex. var x =
738 2; or function f () { var x = 4; }) at global scope or at
741 * Literal.cs: Added parent param to NumericLiteral constructor.
743 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
745 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
747 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
749 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
751 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
752 "instanceof"; }' in order to be able to parse both keywords. When
753 generating the parser, one warning about nondeterminism
754 (k==1:"in") is generated ignore it.
756 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
758 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
759 not parsable now they are. Mozilla's and Janet's test suites are
760 being really helpful.
762 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
764 * jscript-lexer-parser.g: added check for non-null reference at
765 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
766 and multiple lines comments rule.
768 * jscript-lexer-parser.g: Now I keep track of the parent for most
769 of the syntatic constructs. Fixed object_literal rule.
771 * ast.cs: Added field parent. This will help me to track nested
772 blocks for all of the syntatic constructs and will allow to Emit
773 everything in one single pass.
774 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
776 * Block.cs, FunctionObject.cs: deleted parent field as AST will
777 hold it. Delete parent parameter from constructor.
778 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
779 EmitContext class. The idea is Emitting everything in one pass (decls
780 and 'Global Code' method, the parent reference let me know which IL
781 generator use, gc_ig or ig).
782 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
783 constructor. Use new parent reference for choosing the IL
784 generator. NumericLiteral a 'hard coded' int32 IL emittion added
786 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
787 the parent reference to infere which IL generator to use.
788 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
789 reference to infer which IL generator to use.
790 * expression.cs: Added paramenter parent to constructor of: Unary,
791 Binary, Conditional, Call.
793 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
795 * expression.cs: Added new field to Call class, so it can handle more arguments.
797 * StringLiteral.cs (Emit) : Load the string value.
799 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
801 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
802 custom attribute. Build default 'JScript 0' constructor. Emit
803 default initial/final code of 'Global Code'. Create default
806 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
808 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
809 repeating hand written rule all around. Change "." for DOT, dumb
810 mistake by myself. Added rule new_expr. Now we handle properly the
811 call_expr rule (as defined on the spec), and added a new
812 argument. Added subrule new_expr to left_hand_side_expr rule.
814 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
816 * expression.cs (Expression): implemented Emit.
818 * expression.cs (Binary): Emit now creates a local for the
819 different kinds of binary expressions (initial code for this).
821 * ast.cs: Emit method now is abstract instead of virtual.
823 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
825 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
826 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
827 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
828 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
829 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
830 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
831 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
832 Conditional, Call, Identifier, Args, Expression, :
835 * FunctionDeclaration.cs: Check if values are not null first (at
836 Resolve). Ignore code generation is at 'Global Code'.
838 * VariableDeclaration.cs: Now I take care of IL generation when we
839 are at statements and expressions at global code, 'Global Code'
840 method is populated with that IL.
842 * CodeGenerator.cs: Added flag for 'Global Code' method
843 emittion. Now I call 'Emit' twice. The first for declarations the
844 follower for statements and expressions at global scope.
846 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
848 * Visitor.cs: Deleted.
850 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
852 * FormalParameterList.cs: Now inherits from AST. Each of the
853 formal parameters gets into the IdentificationTable at Resolve.
855 * FunctionDeclaration.cs:Resolve (), We open a new block when
856 encountering a FunctionDeclaration, resolve de parameters and the
857 body, at the end we close the block.
859 * IdentificationTable.cs: Now we keep track of parent of the
860 current block. 'Enter (...)' now receives an object, not a
861 VarDecl. 'Contains' now take care of searching through the binding
864 * Literal.cs: Deleted 'Literal' class, was being used for
865 nothing. All the classes the inherited from it, now do it from
866 AST. A 'literal' does resolve to true by default.
868 * Relational.cs: Resolve recursively left and right.
870 * SemanticAnalyser.cs: added flag for 'print statement'.
872 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
875 * driver.cs: Init the semantic analysis phase.
877 * expression.cs: 'Unary' class, resolves its operand
878 first. 'Binary' class,resolves left and right first. 'Args' class
879 resolve all the formal parameters first. 'Expression' resolve all
880 the nested expressions first.
882 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
884 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
886 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
887 this is temporal in order to get Factorial compiled by mjs (must
888 build the types according to Ecma-262 spec).
890 * Literal.cs: Added NumericLiteral class.
892 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
894 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
895 if inside a nested block.
897 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
899 * jscript-lexer-parser.g: Now we take care of parents. This allows
900 to keep track if we are inside nested blocks. At
901 'func_decl_or_expr', now I built the FunctionDeclaration or
902 FunctionExpression first and then assign its body to it - this let
903 me get a non-null value of the FunctionExpression or
904 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
906 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
907 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
908 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
910 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
912 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
913 (gets the name of a function if it's nested). Emit code for
914 function's body. At 'Emit ()' now we take care if it's a nested
917 * FunctionObject.cs: default return type is 'void' not
918 'Object'. Function declarations without parameters map to functions with
919 'Object this' and 'VsaEngine engine' as parameters by
920 default. Assign parent to nested block.
922 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
923 a global declaration or inside a function declaration.
925 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
927 * FunctionObject.cs: Handle no parameters on functions.
929 * jscript-lexer-parser.g: Allow functions without parameters.
931 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
933 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
934 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
935 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
936 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
937 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
938 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
939 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
940 With.cs, expression.cs : Added
941 'Resolve' method stub.
943 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
945 * FormalParameterList.cs: Added FormalParam class. Change Add
946 method to receive the id and the type annotation from function's parameters.
948 * FunctionDeclaration.cs: Added code for initial function's
949 definition code generation.
951 * FunctionObject.cs: Added MethodAttributes and type_annot
952 fields. Added params_types function, which returns an array of
953 types from each of the function's parameters.
955 * IdentificationTable.cs: Added ToString method.
957 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
958 and add it again with the correct name). Not based on the Visitor
959 pattern anymore. Deleted all the VisitFOO methods. Added a
960 IdentificationTable field. Added Run, Dump methods.
962 * Statement.cs: Deleted Statement class (it was being used for
963 nothing). All classes that were having Statement as parent,
964 changed their parent to be AST.
966 * SymbolTable.cs: Added Add method that receives the id and the
967 declaration class. Retrieve changed to return an AST. Added
968 ToString method. Added 'SymbolTable parent' field.
970 * VariableDeclaration.cs: Added InitValue property.
972 * ast.cs: Added some comments and abstract method 'Resolve'.
974 * jscript-lexer-parser.g: Added parsing support for formal
975 parameters type annotations.
977 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
979 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
982 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
984 * jscript-lexer-parser.g: allow empty program files. Added type
985 annotations on var decl and function decl.
986 * VariableDeclaration.cs: added return type annotation field.
987 * FunctionExpression.cs: added return type parameter to constructor.
988 * FunctionDeclaration.cs: added return type parameter to
989 constructor. Added Emit method (just creates the static field at
990 the global object, for now).
991 * FunctionObject.cs: added return type to constructor. Changed
992 names to readable ones ;-)
994 * ScriptStream.cs: added WriteLine.
996 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
998 * ast.cs: Added 'virtual' Emit method (I might change it to be
999 abstract, but I would have to added to all classes that derive
1000 from it. I'll do it later)
1001 * Block.cs: Added Emit method.
1002 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
1003 anymore) - still missing some methods, ut on the way. A nice
1004 hacking weekend coming. Added EmitContext class.
1005 * ScriptBlock.cs: Added Emit method.
1006 * VariableDeclaration.cs: Changed type field from string to
1007 Type. Added Emit method.
1008 * VariableStatement.cs: Added Emit method.
1009 * driver.cs: Added CodeGeneration phase (only simple var
1010 declarations support it. More coming soon).
1013 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
1015 * statement.cs: added Return class.
1017 * Throw.cs: Added expression field, constructor and ToString.
1019 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
1022 * With.cs: added constructor and ToString. Back to the non-tmp
1025 * jscript-parser-lexer.g: allow with_stm tree building.
1027 * jscript-lexer-parser.g: changed the return type from if_stm from
1028 'If' to AST. Added tree for continue_stm. Allowed building of
1031 * statement.cs: switched to internal 'If' class. Added Continue
1032 class. Added Break class.
1034 * jscript-lexer-parser.g: build tree for function decl or expr.
1036 * FunctionDeclaration.cs: added internal constructor.
1038 * FunctionExpression.cs: added internal constructor.
1040 * FunctionObject.cs: added internal constructor and ToString method.
1042 * jscript-lexer-parser.g: added building tree for if_stm.
1043 * Statement.cs: Added if class for 'if' statement.
1046 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
1048 * VariableDeclaration.cs: added the initializer to ToString.
1050 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
1053 * Block.cs, Equality.cs, Relational.cs: modified ToString
1055 * Equality.cs, Relational.cs, StringLiteral.cs,
1056 VariableDeclaration.cs: Added constructor
1058 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
1059 name convetion style to mono style.
1061 * UnaryOp.cs: added operator and operand fields.
1063 * VariableDeclaration.cs: chenged field name from assignExp to val.
1065 * BinaryOp.cs: Made "internal" the attributes, added the two
1068 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
1070 * driver.cs: Dump the string representation of the parsed exps.
1072 * Literal.cs: added BooleanLiteral
1074 * Relational.cs: added constructor, ToString,
1076 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
1078 * README: added some info about hacking the grammar
1080 * JSparser.cs: Updated the constructor to not receiving params.
1082 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
1083 JScriptParserTokenTypes.txt: update of antlr generated files from
1086 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
1087 can parse a little bit more useful programs like:
1089 function factorial (i)
1096 k = factorial (i - 1);
1105 As you can see, it's not the classic factorial function
1106 definition, I still have to make some tricks like storing the
1107 result from the recursive call and then multiply. But this new
1108 grammar it's easier to alter than the old one. Also we got support
1109 for for-in statements, for statements, global expressions, support
1110 for object accesors or better known as the "dot" operator. Two
1111 rules are on the eye: left_hand_size_expr and call_expr, in order
1112 to finish the parsing grammar and fix the bugs.
1115 2003-09-29 <cesar@ciencias.unam.mx>
1117 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
1119 * Added VsaItem.cs, implements IVsaItem.
1121 2003-09-28 <cesar@ciencias.unam.mx>
1123 * VsaItems.cs: Check that no name is repeated (this was docs fault
1124 :-)). This is the beauty of testing.
1126 * Add VsaItems.cs, implements IVsaItems.
1128 2003-09-22 <cesar@ciencias.unam.mx>
1130 * DocumentContext.cs: changed constructor from internal to public,
1131 this a kind of hack ;), but we can build mjs.exe with that change.
1133 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
1134 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
1135 StringLiteral.cs, StringConstructor.cs, Statement.cs,
1136 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
1137 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
1138 Package.cs, ObjectConstructor.cs, NumberObject.cs,
1139 NumberConstructor.cs, MathObject.cs, Literal.cs,
1140 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
1141 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
1142 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
1143 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
1144 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
1145 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
1146 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
1147 ErrorConstructor.cs, EnumeratorObject.cs,
1148 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
1149 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
1150 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
1151 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
1152 ActiveXObjectConstructor.cs, ActivationObject.cs:
1154 indentation comformance to mono style. Returned to
1155 Microsoft.JScript namespace name. Now we can build
1156 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
1157 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
1158 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
1159 about the namespace stuff, because I want people
1160 to contribute NUnit tests for Microsoft.JScript public API.
1162 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
1164 2003-09-21 <cesar@ciencias.unam.mx>
1166 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
1168 2003-09-20 <cesar@ciencias.unam.mx>
1170 * jscript-lexer-parser.g: We are little bit closer to the spec on
1171 StringLiteral definition.
1173 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
1175 * jscript-lexer-parser.g: Build ast for FunctionExpression.
1177 * JSObject.cs: we don't throw NotImplementedException anymore,
1178 this let us use FunctionExpression to build the ast.
1180 * FunctionExpression.cs: Added a FunctionObject as field, a
1181 default constructor.
1183 * FunctionObject.cs: Added default constructor.
1185 * driver.cs: Deleted the Jsc class. We are not generating code
1186 now. I'm moving to provide something like mcs's EmitContext
1187 instead of the CodeGenerator class having the Reflection.Emit
1188 builders and ILGenerator. This driver is just for Lexical and
1189 Parsing phases testing.
1191 * driver.cs: Now we are using the Microsoft.JScript public API
1192 functions to load the lexer and parser.
1194 * ScriptBlock.cs,Block.cs: Added ToString function.
1196 2003-09-20 <cesar@ciencias.unam.mx>
1198 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
1199 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
1200 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
1201 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
1202 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
1203 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
1204 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
1205 : erased Visit method and made some mono indentation style changes.
1207 * CodeGenerator.cs: commented some function calls.
1208 * FunctionDeclaration.cs: moved function attributes to
1209 FunctionObject class, erased Visit method.
1210 * FunctionObject.cs: Here is where we store a function
1211 expression/declaration info, erased Visit method.
1212 * ScriptBlock.cs: Added a Block field, Block will contain the
1214 * jscript-lexer-parser.g: updated the grammar to build the program
1215 representation based on ScriptBlock.
1217 2003-09-19 <cesar@ciencias.unam.mx>
1219 * JSToken.cs: public API compliance.
1221 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1223 * Context.cs: Added constructor and Document field.
1224 * DocumentContext.cs: Added Name field.
1225 * JSParser.cs: Integration of antlr's generated parser with
1226 JSParser public API. ScriptBlock is now the principal data structure that
1227 represents a Jscript .Net program.
1228 * JSScanner.cs: Integration of antlr's generated lexer with
1229 JSScanner public API.
1231 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1232 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
1234 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1236 * jscript-lexer-parser.g: Changed the namespace to
1237 Microsoft.JScript.Tmp.
1239 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
1241 * jscript-lexer-parser.g: Got the name of a
1242 global_function_declaration and also its return type if
1245 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
1246 * jscript-lexer-parser.g: Initial construction of AST for
1247 enum_statement and package_statement.
1249 * jscript-lexer-parser.g: Fixed the enum_statement to accept
1250 empty enum declarations.
1252 * jscript-lexer-parser.g: Got the type of a
1253 veriable_declaration.
1255 * jscript-lexer-parser.g: Initial construction of AST for
1256 primary_expression (in particular literal).
1259 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1261 * driver.cs: Modified the driver structure to be compatible
1262 with our new CodeGenrator and SemanticAnalizer. I
1263 removed the builders from Reflection.Emit to the
1264 CodeGenerator. Added an ASTList, SemanticAnalizer and
1265 CodeGenerator here. Adde methods Run, GenerateCode
1268 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1269 * Statement.cs: Forgot to include it on last commit.
1271 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1273 * Decided to change temporarly namespace name
1274 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
1275 to run the code generated by our CIL code generator (on next
1276 commit will come). The problem is that we don't have the
1277 runtime support for our compiler, this involve VsaEngine class
1278 and its "friends", which I have not found a lot of
1279 doumentation for. If someone knows a docs place for them,
1280 don't hesitate to send me a email pointing to them.
1282 * Changed from public to internal Visit function at some
1285 * Package.cs: Added Name and Members fields.
1287 * SemanticAnalizer.cs: Added methods VisitPrint and
1290 * VariableDeclaration.cs: Added Type field.
1292 * Visitor.cs: Changed from public to internal. Added
1293 VisitPrint and VisitStringLiteral methods.
1295 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
1296 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
1301 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1303 * Added CmdLineError.cs and JSError.cs, last night I forgot to
1306 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1308 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
1309 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
1310 CmdLineException.cs, CmdLineOptionParser.cs,
1311 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
1312 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
1313 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
1314 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
1315 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
1316 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
1317 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
1318 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
1319 LenientDateConstructor.cs, LenientDatePrototype.cs,
1320 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
1321 LenientFunctionPrototype.cs, LenientMathObject.cs,
1322 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
1323 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
1324 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
1325 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
1326 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
1327 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
1328 PostOrPrefixOperator.cs, RangeErrorObject.cs,
1329 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
1330 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
1331 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
1332 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
1333 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
1334 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
1335 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
1336 VersionableAttribute.cs
1338 Now, I must fill in the blanks :-)
1341 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1342 * jscript-lexer-parser.g: Added conditional_compilation_directive,
1343 which is the beginning of our support for conditional compilation
1344 statements and directives in our parser. Added
1345 cc_on_statement, and some lexer rules for getting the needed
1346 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
1347 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
1350 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1352 * jscript-lexer-parser.g: Changed the format of copyright notice.
1354 This changes will allow the support
1355 for the grammar added by MS to EcmaScript (aka its JScript .Net),
1356 I'm still missing some, but they are on the way.
1358 * jscript-lexer-parser.g: Deleted function_declaration, and
1359 added global_function_declaration and type_function_declaration.
1360 I decided to make the grammar as strict as the MS docs mark,
1361 but there's a difference between what their docs says and what
1362 their compiler does. For this case I decided to follow the
1363 docs. A program like:
1364 private function F ()
1366 according to the docs, would not be syntaticly correct. But the MS
1367 compiler, accepts the grammar construct and mark the error at
1368 semantic analysis phase. I followed the docs this time.
1370 * jscript-lexer-parser.g: Added debbuger_statement.
1371 * jscript-lexer-parser.g: Added import_statement.
1372 * jscript-lexer-parser.g: Added package_statement and package_member(s).
1373 * jscript-lexer-parser.g: Added super_statement.
1374 * jscript-lexer-parser.g: Added const_statement.
1375 * jscript-lexer-parser.g: Added class_statement,
1376 interfaces_list and class_members.
1378 * jscript-lexer-parser.g: Added interface_statement and
1381 * jscript-lexer-parser.g: Added enum_statement.
1382 * jscript-lexer-parser.g: Added static_statement. The rule for
1383 this syntatic construc is: static identifier { [body] }
1384 body does not get well specified in the docs. Must search wich
1385 are the possible values of it.
1387 * jscript-lexer-parser.g: At variable_declaration, added
1388 support for explicit type declaration.
1390 * jscript-lexer-parser.g: Added numeric_literal,
1391 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
1393 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
1396 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1399 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
1400 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
1401 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
1404 That method will be the driver that will allow classes
1405 that implement the Visitor interface do a walk through the AST's
1406 elements, in particular the Semantic Analizer and the Code
1407 Generator. Every class that inherits from AST will have a Visit
1408 method, that method will receive a Visitor and a object as
1409 parameters, the only thing that it'll do is letting the Visitor
1410 call the respective method VisitX, where X is the name of the
1411 currently visited class.
1413 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
1415 * FunctionDeclaration.cs: Added constructor, Visit and ToString
1418 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
1419 program (the main entry of the parser). Also added as parameters:
1420 - An AST to source_element.
1421 - A Statement to statement.
1422 - A VariableStatement to variable_statement.
1423 - A VariableStatement to variable_declaration_list.
1424 - A FormalParamerList by formal_parameter_list.
1425 - A ASTList by function_body.
1427 And now some rules return objects:
1428 - A VariableDeclaration by variable_declaration.
1429 - A Functiondeclaration by function_declaration.
1431 * driver.cs: Added the construction of the AST of the EcmaScript
1434 * Visitor.cs: Added this file. It's the visitor interface.
1436 * VariableDeclaration.cs: Added this class, it's the AST
1437 representation of a variable declaration.
1439 * Statement.cs: Added this file. It's the logical representation
1442 * VariableStatement.cs: Added this class. It's the AST
1443 representation of a chain of variable declarations.
1445 * FormalParameterList.cs: The function declaration needs to store
1446 its parameter, we will put them on this class.
1448 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
1449 implement the semantic analysis and code generation
1450 phases. SemanticAnalizer and CodeGenerator will implement the
1451 Visitor interface, they will walk a program's
1452 AST tree and do their respective work.
1454 * IdentificationTable.cs: Added this class. The SymbolTable will be used
1455 by the SemanticAnalyzer in order to keep track of the variable
1456 declaration encountered, etc..
1458 * SymbolTable.cs: A simple hashtable but for commodity i'll call
1462 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1464 * jscript-lexer-parser.g:
1465 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
1466 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
1467 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
1468 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
1469 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
1470 - Changed INTERROGATION to CONDITIONAL.
1471 - Changed TRIANGLE to BITWISE_XOR.
1472 - Changed SLASH to DIVISION.
1473 - Changed PERCENT to REMAINDER.
1474 - Changed ADMIRATION to LOGICAL_NOT
1475 - Added BITWISE_NOT (~).
1476 - Added the INCREMENT and DECREMENT rules for
1477 left_hand_side_expression.
1478 - Increased lexer lookup from 2 to 4.
1479 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
1480 BITWISE_AND, BITWISE_OR,
1481 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
1482 REMAINDER, UNSIGNED_RIGHT_SHIFT.
1483 - Added the recursion rules for equality_expression.
1484 - Added the recursion rules for shift_expression.
1486 - The most important thing, added support for expressions like:
1489 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1492 - Erased the Context class, it was used for the first
1493 test of the print_statement and Reflection.Emit. As I erased the
1494 Program, SourceElements, SourceElement from the ANTLR grammar (for
1495 the rework of the AST tied to the MS JScript public API), I erased
1497 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
1498 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
1499 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
1502 * jscript-lexer-parser.g:
1503 - Erased the references to the classes Program, SourceElements,
1504 SourceElement, Statement, FunctionDeclaration and erased
1505 print_statement rule.
1507 * JSCriptLexer.cs JScriptParser.cs and the other files generated
1508 by antlr, reflect changes from the grammar changes.
1510 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1511 * Added stubs for the classes:
1514 ActiveXObjectConstructor.cs
1518 AssemblyCustomAttributeList.cs
1523 BooleanConstructor.cs
1531 EnumeratorConstructor.cs
1537 FunctionConstructor.cs
1538 FunctionDeclaration.cs
1539 FunctionExpression.cs
1543 IActivationObject.cs
1549 JSFunctionAttribute.cs
1550 JSFunctionAttributeEnum.cs
1555 LenientGlobalObject.cs
1557 NumberConstructor.cs
1559 ObjectConstructor.cs
1561 RegExpConstructor.cs
1566 StringConstructor.cs
1571 VBArrayConstructor.cs
1576 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1578 * jscript-lexer-parser.g:
1579 - Added rules for: continue_statement, break_statement,
1580 return_statement, throw statement (all of them do not ensure that
1581 no LineSeparator appears between the keyword on the left and the
1582 identifier, expression or semicolon on the right, that must be fixed).
1583 - Added single line comments rule.
1585 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1587 * jscript-lexer-parser.g: Added syntatic rule for:
1589 - while and for-in subrules of iteration_statement.
1590 - Added array_literal - got tricky - I just could get the simplest rule going :)
1594 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1596 * jscript-lexer-parser.g:
1597 - Syntatic rule for iteration_statement.
1598 - "do" subrule for it.
1599 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
1600 "in") relational_expression | ) rule to relational_expression.
1601 -Added function_expression syntatic rule.
1602 - Added STRING_LITERAL to literal rules.
1603 - "Less/Greater or equal than" lexer rule.
1605 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1607 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
1609 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1611 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
1614 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1616 * Added a README file. Explains the dependencies and build process.
1618 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
1620 * Added this ChangeLog file.
1622 * ast.cs: Added this file. Contains the classes used for building
1623 the EcmaScript 's AST.
1625 * JScript*: These are the files generated by antlr (the parser generator).
1627 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
1629 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
1630 that will be moved to other file in the future.
1632 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.