1 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
3 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
4 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
5 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
6 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
7 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
9 * UnaryOp.cs: inherit from Exp now.
10 * Plus.cs: Don't throw the exception when calling constructor, let
11 it build the default handler. Return a new object when calling
12 EvaluatePlus until properly implemented.
14 * NumericUnary.cs: added new Resolve.
15 * NumericBinary.cs: assign operator val at ctr. Return a new
16 object when calling EvaluateNumericBinary until properly
17 implemented. Added Resolve.
18 * Equality.cs: added ctr and return false for EvaluateEquality
19 until properly implemented. Added Resolve's functions.
21 * Block.cs (Resolve): That check was not necessary.
23 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
24 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
25 BinaryOp and UnaryOp, and this from Exp.
26 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
27 * jscript-lexer-parser.g: deleted debugging messages. Create a
28 Assign object instance of a simple Binary obj. Same case for Equality.
30 * expression.cs: added Exp abstract class. Classes that are ast of
31 language constructions that can appear as global expressions that
32 get evaluated and then the result is discarded inherit from this
33 new class. This let meee keep track of things that must get Popped
34 or can even avoid the evaluation of it. Wrote real Resolve method
35 for classes: Unary, Binary.
36 Implemted Emit method for some binary operations (+, -, / and *),
37 for other operators some more code is still missing.
38 Identifier: handle assignment cases and global exp cases.
39 Added class Assign (compisite assignment still missing tough :-(
41 * driver.cs: deleted debug messages, added "Compilation Succeeded"
43 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
44 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
45 Exp and handle the case for global expressions that must be popped
46 after evaluation. no more invalid IL being generated! yeah!
47 * Block.cs: wrote real Resolve method, erased debug messages.
48 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
49 * BinaryOp.cs, Conditional: now inherits from Exp.
51 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
53 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
55 * CodeGenerator.cs: small fixes to generate same things that ms.
57 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
59 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
61 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
63 * JSMethodInfo.cs : tiny fix for NET_1_2 build.
65 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
67 * jscript-lexer-parser.g: keep track of parent reference for
68 IDENTIFIER, STRING_LITERAL.
70 * expression.cs: Added 'binding' field. Added 'parent' parameter
71 to constructor. Now we emit the proper code for the identifier.
73 * VariableStatement.cs: updated to field names instead of the old
76 * VariableDeclaration.cs: Added class Decl, it constains the
77 references to the static field or LocalBuilder that are created
78 when a declaration is emitted. Deleted unuseful properties (Id,
81 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
82 object instead of a boolean.
84 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
86 * IdentificationTable.cs: Deleted Retrieve method. Contains method
87 now return an object instead of a boolean, that reference is the
88 binding associated with the identifier being searched.
90 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
92 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
94 * VariableDeclaration.cs: now I handle initialization (ex. var x =
95 2; or function f () { var x = 4; }) at global scope or at
98 * Literal.cs: Added parent param to NumericLiteral constructor.
100 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
102 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
104 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
106 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
108 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
109 "instanceof"; }' in order to be able to parse both keywords. When
110 generating the parser, one warning about nondeterminism
111 (k==1:"in") is generated ignore it.
113 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
115 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
116 not parsable now they are. Mozilla's and Janet's test suites are
117 being really helpful.
119 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
121 * jscript-lexer-parser.g: added check for non-null reference at
122 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
123 and multiple lines comments rule.
125 * jscript-lexer-parser.g: Now I keep track of the parent for most
126 of the syntatic constructs. Fixed object_literal rule.
128 * ast.cs: Added field parent. This will help me to track nested
129 blocks for all of the syntatic constructs and will allow to Emit
130 everything in one single pass.
131 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
133 * Block.cs, FunctionObject.cs: deleted parent field as AST will
134 hold it. Delete parent parameter from constructor.
135 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
136 EmitContext class. The idea is Emitting everything in one pass (decls
137 and 'Global Code' method, the parent reference let me know which IL
138 generator use, gc_ig or ig).
139 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
140 constructor. Use new parent reference for choosing the IL
141 generator. NumericLiteral a 'hard coded' int32 IL emittion added
143 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
144 the parent reference to infere which IL generator to use.
145 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
146 reference to infer which IL generator to use.
147 * expression.cs: Added paramenter parent to constructor of: Unary,
148 Binary, Conditional, Call.
150 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
152 * expression.cs: Added new field to Call class, so it can handle more arguments.
154 * StringLiteral.cs (Emit) : Load the string value.
156 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
158 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
159 custom attribute. Build default 'JScript 0' constructor. Emit
160 default initial/final code of 'Global Code'. Create default
163 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
165 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
166 repeating hand written rule all around. Change "." for DOT, dumb
167 mistake by myself. Added rule new_expr. Now we handle properly the
168 call_expr rule (as defined on the spec), and added a new
169 argument. Added subrule new_expr to left_hand_side_expr rule.
171 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
173 * expression.cs (Expression): implemented Emit.
175 * expression.cs (Binary): Emit now creates a local for the
176 different kinds of binary expressions (initial code for this).
178 * ast.cs: Emit method now is abstract instead of virtual.
180 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
182 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
183 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
184 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
185 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
186 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
187 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
188 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
189 Conditional, Call, Identifier, Args, Expression, :
192 * FunctionDeclaration.cs: Check if values are not null first (at
193 Resolve). Ignore code generation is at 'Global Code'.
195 * VariableDeclaration.cs: Now I take care of IL generation when we
196 are at statements and expressions at global code, 'Global Code'
197 method is populated with that IL.
199 * CodeGenerator.cs: Added flag for 'Global Code' method
200 emittion. Now I call 'Emit' twice. The first for declarations the
201 follower for statements and expressions at global scope.
203 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
205 * Visitor.cs: Deleted.
207 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
209 * FormalParameterList.cs: Now inherits from AST. Each of the
210 formal parameters gets into the IdentificationTable at Resolve.
212 * FunctionDeclaration.cs:Resolve (), We open a new block when
213 encountering a FunctionDeclaration, resolve de parameters and the
214 body, at the end we close the block.
216 * IdentificationTable.cs: Now we keep track of parent of the
217 current block. 'Enter (...)' now receives an object, not a
218 VarDecl. 'Contains' now take care of searching through the binding
221 * Literal.cs: Deleted 'Literal' class, was being used for
222 nothing. All the classes the inherited from it, now do it from
223 AST. A 'literal' does resolve to true by default.
225 * Relational.cs: Resolve recursively left and right.
227 * SemanticAnalyser.cs: added flag for 'print statement'.
229 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
232 * driver.cs: Init the semantic analysis phase.
234 * expression.cs: 'Unary' class, resolves its operand
235 first. 'Binary' class,resolves left and right first. 'Args' class
236 resolve all the formal parameters first. 'Expression' resolve all
237 the nested expressions first.
239 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
241 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
243 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
244 this is temporal in order to get Factorial compiled by mjs (must
245 build the types according to Ecma-262 spec).
247 * Literal.cs: Added NumericLiteral class.
249 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
251 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
252 if inside a nested block.
254 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
256 * jscript-lexer-parser.g: Now we take care of parents. This allows
257 to keep track if we are inside nested blocks. At
258 'func_decl_or_expr', now I built the FunctionDeclaration or
259 FunctionExpression first and then assign its body to it - this let
260 me get a non-null value of the FunctionExpression or
261 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
263 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
264 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
265 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
267 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
269 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
270 (gets the name of a function if it's nested). Emit code for
271 function's body. At 'Emit ()' now we take care if it's a nested
274 * FunctionObject.cs: default return type is 'void' not
275 'Object'. Function declarations without parameters map to functions with
276 'Object this' and 'VsaEngine engine' as parameters by
277 default. Assign parent to nested block.
279 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
280 a global declaration or inside a function declaration.
282 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
284 * FunctionObject.cs: Handle no parameters on functions.
286 * jscript-lexer-parser.g: Allow functions without parameters.
288 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
290 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
291 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
292 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
293 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
294 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
295 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
296 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
297 With.cs, expression.cs : Added
298 'Resolve' method stub.
300 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
302 * FormalParameterList.cs: Added FormalParam class. Change Add
303 method to receive the id and the type annotation from function's parameters.
305 * FunctionDeclaration.cs: Added code for initial function's
306 definition code generation.
308 * FunctionObject.cs: Added MethodAttributes and type_annot
309 fields. Added params_types function, which returns an array of
310 types from each of the function's parameters.
312 * IdentificationTable.cs: Added ToString method.
314 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
315 and add it again with the correct name). Not based on the Visitor
316 pattern anymore. Deleted all the VisitFOO methods. Added a
317 IdentificationTable field. Added Run, Dump methods.
319 * Statement.cs: Deleted Statement class (it was being used for
320 nothing). All classes that were having Statement as parent,
321 changed their parent to be AST.
323 * SymbolTable.cs: Added Add method that receives the id and the
324 declaration class. Retrieve changed to return an AST. Added
325 ToString method. Added 'SymbolTable parent' field.
327 * VariableDeclaration.cs: Added InitValue property.
329 * ast.cs: Added some comments and abstract method 'Resolve'.
331 * jscript-lexer-parser.g: Added parsing support for formal
332 parameters type annotations.
334 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
336 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
339 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
341 * jscript-lexer-parser.g: allow empty program files. Added type
342 annotations on var decl and function decl.
343 * VariableDeclaration.cs: added return type annotation field.
344 * FunctionExpression.cs: added return type parameter to constructor.
345 * FunctionDeclaration.cs: added return type parameter to
346 constructor. Added Emit method (just creates the static field at
347 the global object, for now).
348 * FunctionObject.cs: added return type to constructor. Changed
349 names to readable ones ;-)
351 * ScriptStream.cs: added WriteLine.
353 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
355 * ast.cs: Added 'virtual' Emit method (I might change it to be
356 abstract, but I would have to added to all classes that derive
357 from it. I'll do it later)
358 * Block.cs: Added Emit method.
359 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
360 anymore) - still missing some methods, ut on the way. A nice
361 hacking weekend coming. Added EmitContext class.
362 * ScriptBlock.cs: Added Emit method.
363 * VariableDeclaration.cs: Changed type field from string to
364 Type. Added Emit method.
365 * VariableStatement.cs: Added Emit method.
366 * driver.cs: Added CodeGeneration phase (only simple var
367 declarations support it. More coming soon).
370 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
372 * statement.cs: added Return class.
374 * Throw.cs: Added expression field, constructor and ToString.
376 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
379 * With.cs: added constructor and ToString. Back to the non-tmp
382 * jscript-parser-lexer.g: allow with_stm tree building.
384 * jscript-lexer-parser.g: changed the return type from if_stm from
385 'If' to AST. Added tree for continue_stm. Allowed building of
388 * statement.cs: switched to internal 'If' class. Added Continue
389 class. Added Break class.
391 * jscript-lexer-parser.g: build tree for function decl or expr.
393 * FunctionDeclaration.cs: added internal constructor.
395 * FunctionExpression.cs: added internal constructor.
397 * FunctionObject.cs: added internal constructor and ToString method.
399 * jscript-lexer-parser.g: added building tree for if_stm.
400 * Statement.cs: Added if class for 'if' statement.
403 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
405 * VariableDeclaration.cs: added the initializer to ToString.
407 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
410 * Block.cs, Equality.cs, Relational.cs: modified ToString
412 * Equality.cs, Relational.cs, StringLiteral.cs,
413 VariableDeclaration.cs: Added constructor
415 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
416 name convetion style to mono style.
418 * UnaryOp.cs: added operator and operand fields.
420 * VariableDeclaration.cs: chenged field name from assignExp to val.
422 * BinaryOp.cs: Made "internal" the attributes, added the two
425 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
427 * driver.cs: Dump the string representation of the parsed exps.
429 * Literal.cs: added BooleanLiteral
431 * Relational.cs: added constructor, ToString,
433 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
435 * README: added some info about hacking the grammar
437 * JSparser.cs: Updated the constructor to not receiving params.
439 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
440 JScriptParserTokenTypes.txt: update of antlr generated files from
443 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
444 can parse a little bit more useful programs like:
446 function factorial (i)
453 k = factorial (i - 1);
462 As you can see, it's not the classic factorial function
463 definition, I still have to make some tricks like storing the
464 result from the recursive call and then multiply. But this new
465 grammar it's easier to alter than the old one. Also we got support
466 for for-in statements, for statements, global expressions, support
467 for object accesors or better known as the "dot" operator. Two
468 rules are on the eye: left_hand_size_expr and call_expr, in order
469 to finish the parsing grammar and fix the bugs.
472 2003-09-29 <cesar@ciencias.unam.mx>
474 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
476 * Added VsaItem.cs, implements IVsaItem.
478 2003-09-28 <cesar@ciencias.unam.mx>
480 * VsaItems.cs: Check that no name is repeated (this was docs fault
481 :-)). This is the beauty of testing.
483 * Add VsaItems.cs, implements IVsaItems.
485 2003-09-22 <cesar@ciencias.unam.mx>
487 * DocumentContext.cs: changed constructor from internal to public,
488 this a kind of hack ;), but we can build mjs.exe with that change.
490 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
491 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
492 StringLiteral.cs, StringConstructor.cs, Statement.cs,
493 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
494 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
495 Package.cs, ObjectConstructor.cs, NumberObject.cs,
496 NumberConstructor.cs, MathObject.cs, Literal.cs,
497 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
498 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
499 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
500 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
501 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
502 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
503 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
504 ErrorConstructor.cs, EnumeratorObject.cs,
505 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
506 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
507 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
508 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
509 ActiveXObjectConstructor.cs, ActivationObject.cs:
511 indentation comformance to mono style. Returned to
512 Microsoft.JScript namespace name. Now we can build
513 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
514 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
515 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
516 about the namespace stuff, because I want people
517 to contribute NUnit tests for Microsoft.JScript public API.
519 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
521 2003-09-21 <cesar@ciencias.unam.mx>
523 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
525 2003-09-20 <cesar@ciencias.unam.mx>
527 * jscript-lexer-parser.g: We are little bit closer to the spec on
528 StringLiteral definition.
530 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
532 * jscript-lexer-parser.g: Build ast for FunctionExpression.
534 * JSObject.cs: we don't throw NotImplementedException anymore,
535 this let us use FunctionExpression to build the ast.
537 * FunctionExpression.cs: Added a FunctionObject as field, a
540 * FunctionObject.cs: Added default constructor.
542 * driver.cs: Deleted the Jsc class. We are not generating code
543 now. I'm moving to provide something like mcs's EmitContext
544 instead of the CodeGenerator class having the Reflection.Emit
545 builders and ILGenerator. This driver is just for Lexical and
546 Parsing phases testing.
548 * driver.cs: Now we are using the Microsoft.JScript public API
549 functions to load the lexer and parser.
551 * ScriptBlock.cs,Block.cs: Added ToString function.
553 2003-09-20 <cesar@ciencias.unam.mx>
555 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
556 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
557 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
558 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
559 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
560 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
561 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
562 : erased Visit method and made some mono indentation style changes.
564 * CodeGenerator.cs: commented some function calls.
565 * FunctionDeclaration.cs: moved function attributes to
566 FunctionObject class, erased Visit method.
567 * FunctionObject.cs: Here is where we store a function
568 expression/declaration info, erased Visit method.
569 * ScriptBlock.cs: Added a Block field, Block will contain the
571 * jscript-lexer-parser.g: updated the grammar to build the program
572 representation based on ScriptBlock.
574 2003-09-19 <cesar@ciencias.unam.mx>
576 * JSToken.cs: public API compliance.
578 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
580 * Context.cs: Added constructor and Document field.
581 * DocumentContext.cs: Added Name field.
582 * JSParser.cs: Integration of antlr's generated parser with
583 JSParser public API. ScriptBlock is now the principal data structure that
584 represents a Jscript .Net program.
585 * JSScanner.cs: Integration of antlr's generated lexer with
586 JSScanner public API.
588 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
589 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
591 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
593 * jscript-lexer-parser.g: Changed the namespace to
594 Microsoft.JScript.Tmp.
596 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
598 * jscript-lexer-parser.g: Got the name of a
599 global_function_declaration and also its return type if
602 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
603 * jscript-lexer-parser.g: Initial construction of AST for
604 enum_statement and package_statement.
606 * jscript-lexer-parser.g: Fixed the enum_statement to accept
607 empty enum declarations.
609 * jscript-lexer-parser.g: Got the type of a
610 veriable_declaration.
612 * jscript-lexer-parser.g: Initial construction of AST for
613 primary_expression (in particular literal).
616 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
618 * driver.cs: Modified the driver structure to be compatible
619 with our new CodeGenrator and SemanticAnalizer. I
620 removed the builders from Reflection.Emit to the
621 CodeGenerator. Added an ASTList, SemanticAnalizer and
622 CodeGenerator here. Adde methods Run, GenerateCode
625 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
626 * Statement.cs: Forgot to include it on last commit.
628 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
630 * Decided to change temporarly namespace name
631 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
632 to run the code generated by our CIL code generator (on next
633 commit will come). The problem is that we don't have the
634 runtime support for our compiler, this involve VsaEngine class
635 and its "friends", which I have not found a lot of
636 doumentation for. If someone knows a docs place for them,
637 don't hesitate to send me a email pointing to them.
639 * Changed from public to internal Visit function at some
642 * Package.cs: Added Name and Members fields.
644 * SemanticAnalizer.cs: Added methods VisitPrint and
647 * VariableDeclaration.cs: Added Type field.
649 * Visitor.cs: Changed from public to internal. Added
650 VisitPrint and VisitStringLiteral methods.
652 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
653 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
658 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
660 * Added CmdLineError.cs and JSError.cs, last night I forgot to
663 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
665 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
666 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
667 CmdLineException.cs, CmdLineOptionParser.cs,
668 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
669 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
670 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
671 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
672 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
673 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
674 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
675 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
676 LenientDateConstructor.cs, LenientDatePrototype.cs,
677 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
678 LenientFunctionPrototype.cs, LenientMathObject.cs,
679 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
680 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
681 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
682 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
683 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
684 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
685 PostOrPrefixOperator.cs, RangeErrorObject.cs,
686 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
687 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
688 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
689 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
690 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
691 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
692 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
693 VersionableAttribute.cs
695 Now, I must fill in the blanks :-)
698 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
699 * jscript-lexer-parser.g: Added conditional_compilation_directive,
700 which is the beginning of our support for conditional compilation
701 statements and directives in our parser. Added
702 cc_on_statement, and some lexer rules for getting the needed
703 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
704 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
707 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
709 * jscript-lexer-parser.g: Changed the format of copyright notice.
711 This changes will allow the support
712 for the grammar added by MS to EcmaScript (aka its JScript .Net),
713 I'm still missing some, but they are on the way.
715 * jscript-lexer-parser.g: Deleted function_declaration, and
716 added global_function_declaration and type_function_declaration.
717 I decided to make the grammar as strict as the MS docs mark,
718 but there's a difference between what their docs says and what
719 their compiler does. For this case I decided to follow the
720 docs. A program like:
721 private function F ()
723 according to the docs, would not be syntaticly correct. But the MS
724 compiler, accepts the grammar construct and mark the error at
725 semantic analysis phase. I followed the docs this time.
727 * jscript-lexer-parser.g: Added debbuger_statement.
728 * jscript-lexer-parser.g: Added import_statement.
729 * jscript-lexer-parser.g: Added package_statement and package_member(s).
730 * jscript-lexer-parser.g: Added super_statement.
731 * jscript-lexer-parser.g: Added const_statement.
732 * jscript-lexer-parser.g: Added class_statement,
733 interfaces_list and class_members.
735 * jscript-lexer-parser.g: Added interface_statement and
738 * jscript-lexer-parser.g: Added enum_statement.
739 * jscript-lexer-parser.g: Added static_statement. The rule for
740 this syntatic construc is: static identifier { [body] }
741 body does not get well specified in the docs. Must search wich
742 are the possible values of it.
744 * jscript-lexer-parser.g: At variable_declaration, added
745 support for explicit type declaration.
747 * jscript-lexer-parser.g: Added numeric_literal,
748 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
750 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
753 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
756 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
757 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
758 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
761 That method will be the driver that will allow classes
762 that implement the Visitor interface do a walk through the AST's
763 elements, in particular the Semantic Analizer and the Code
764 Generator. Every class that inherits from AST will have a Visit
765 method, that method will receive a Visitor and a object as
766 parameters, the only thing that it'll do is letting the Visitor
767 call the respective method VisitX, where X is the name of the
768 currently visited class.
770 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
772 * FunctionDeclaration.cs: Added constructor, Visit and ToString
775 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
776 program (the main entry of the parser). Also added as parameters:
777 - An AST to source_element.
778 - A Statement to statement.
779 - A VariableStatement to variable_statement.
780 - A VariableStatement to variable_declaration_list.
781 - A FormalParamerList by formal_parameter_list.
782 - A ASTList by function_body.
784 And now some rules return objects:
785 - A VariableDeclaration by variable_declaration.
786 - A Functiondeclaration by function_declaration.
788 * driver.cs: Added the construction of the AST of the EcmaScript
791 * Visitor.cs: Added this file. It's the visitor interface.
793 * VariableDeclaration.cs: Added this class, it's the AST
794 representation of a variable declaration.
796 * Statement.cs: Added this file. It's the logical representation
799 * VariableStatement.cs: Added this class. It's the AST
800 representation of a chain of variable declarations.
802 * FormalParameterList.cs: The function declaration needs to store
803 its parameter, we will put them on this class.
805 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
806 implement the semantic analysis and code generation
807 phases. SemanticAnalizer and CodeGenerator will implement the
808 Visitor interface, they will walk a program's
809 AST tree and do their respective work.
811 * IdentificationTable.cs: Added this class. The SymbolTable will be used
812 by the SemanticAnalyzer in order to keep track of the variable
813 declaration encountered, etc..
815 * SymbolTable.cs: A simple hashtable but for commodity i'll call
819 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
821 * jscript-lexer-parser.g:
822 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
823 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
824 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
825 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
826 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
827 - Changed INTERROGATION to CONDITIONAL.
828 - Changed TRIANGLE to BITWISE_XOR.
829 - Changed SLASH to DIVISION.
830 - Changed PERCENT to REMAINDER.
831 - Changed ADMIRATION to LOGICAL_NOT
832 - Added BITWISE_NOT (~).
833 - Added the INCREMENT and DECREMENT rules for
834 left_hand_side_expression.
835 - Increased lexer lookup from 2 to 4.
836 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
837 BITWISE_AND, BITWISE_OR,
838 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
839 REMAINDER, UNSIGNED_RIGHT_SHIFT.
840 - Added the recursion rules for equality_expression.
841 - Added the recursion rules for shift_expression.
843 - The most important thing, added support for expressions like:
846 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
849 - Erased the Context class, it was used for the first
850 test of the print_statement and Reflection.Emit. As I erased the
851 Program, SourceElements, SourceElement from the ANTLR grammar (for
852 the rework of the AST tied to the MS JScript public API), I erased
854 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
855 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
856 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
859 * jscript-lexer-parser.g:
860 - Erased the references to the classes Program, SourceElements,
861 SourceElement, Statement, FunctionDeclaration and erased
862 print_statement rule.
864 * JSCriptLexer.cs JScriptParser.cs and the other files generated
865 by antlr, reflect changes from the grammar changes.
867 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
868 * Added stubs for the classes:
871 ActiveXObjectConstructor.cs
875 AssemblyCustomAttributeList.cs
880 BooleanConstructor.cs
888 EnumeratorConstructor.cs
894 FunctionConstructor.cs
895 FunctionDeclaration.cs
896 FunctionExpression.cs
906 JSFunctionAttribute.cs
907 JSFunctionAttributeEnum.cs
912 LenientGlobalObject.cs
928 VBArrayConstructor.cs
933 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
935 * jscript-lexer-parser.g:
936 - Added rules for: continue_statement, break_statement,
937 return_statement, throw statement (all of them do not ensure that
938 no LineSeparator appears between the keyword on the left and the
939 identifier, expression or semicolon on the right, that must be fixed).
940 - Added single line comments rule.
942 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
944 * jscript-lexer-parser.g: Added syntatic rule for:
946 - while and for-in subrules of iteration_statement.
947 - Added array_literal - got tricky - I just could get the simplest rule going :)
951 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
953 * jscript-lexer-parser.g:
954 - Syntatic rule for iteration_statement.
955 - "do" subrule for it.
956 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
957 "in") relational_expression | ) rule to relational_expression.
958 -Added function_expression syntatic rule.
959 - Added STRING_LITERAL to literal rules.
960 - "Less/Greater or equal than" lexer rule.
962 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
964 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
966 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
968 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
971 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
973 * Added a README file. Explains the dependencies and build process.
975 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
977 * Added this ChangeLog file.
979 * ast.cs: Added this file. Contains the classes used for building
980 the EcmaScript 's AST.
982 * JScript*: These are the files generated by antlr (the parser generator).
984 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
986 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
987 that will be moved to other file in the future.
989 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.