1 2005-11-22 Cesar Lopez Nataren <cnataren@novell.com>
3 * Statement.cs (Return.Resolve): Added field exp_returns_void
4 which allow us to return a method call as the return expression
5 value even when the method call returns void; we emit null in such
8 * ast.cs (Function): switch from 'protected' to 'internal'
9 property HandleReturnType.
11 2005-11-21 Cesar Lopez Nataren <cnataren@novell.com>
13 * Statement.cs (class Switch): Preserve the value of
14 EmitContext.LoopEnd as can be overriden in nested blocks, for
15 example in a switch statement inside a for-loop.
17 2005-10-28 Raja R Harinath <rharinath@novell.com>
19 * Import.cs (Resolve): Update to changes in GMCS.
20 * SemanticAnalizer.cs (ComputeNamespace): Likewise.
22 2005-10-23 Florian Gross <flgr@ccan.de>
24 * LateBinding.cs: Changed to accept object instead of ScriptObject in a lot of places
26 2005-10-23 Raja R Harinath <harinath@gmail.com>
28 * Import.cs (Resolve): Update to changes in MCS code.
30 2005-10-11 Cesar Lopez Nataren <cnataren@novell.com>
32 * CodeGenerator.cs (CodeGenerator): EmitRelationalComp handle 'in'
35 * Add support for multiple files compilation. This involved addig
36 an extra pass into the AST for ensuring the resolve process, this
37 pass is named PopulateContext. The AST nodes that implement
38 ICanModifyContext call PopulateContext.
40 * IdentificationTable.cs: Added class Environment, which is a
41 symbol table which takes into account namespace info, this is for
42 package statement future implementation.
44 2005-09-30 Cesar Lopez Nataren <cnataren@novell.com>
46 * expression.cs (Expression::Resolve): check if we have an
47 assigment in a chain of expressions and stms, it fixes
48 #75801, and give us 660 more successful tests.
50 2005-09-13 Cesar Lopez Nataren <cnataren@novell.com>
52 * SemanticAnalyser.cs: Add field assemblies. Run now receives the
53 assembly's array, add method ComputeNamespaces,
54 * Parser.cs: Add support for the 'import' statement. Add field
55 code_items, new constructor, methods ParseAll and Import.
56 * Import.cs: Implement Resolve and Emit methods.
57 * ScriptBlock.cs: Add default ctr.
59 2005-09-11 Cesar Lopez Nataren <cnataren@novell.com>
61 * expression.cs (Identifier::emit_undeclared_assignment): Fix
62 small regression related to the value/refs patch. All works again
63 for undeclared variables.
65 2005-09-09 Cesar Lopez Nataren <cnataren@novell.com>
67 * SemanticAnalyser.cs, expression.cs (Unary): Fixes for delete
70 2005-09-08 Cesar Lopez Nataren <cnataren@novell.com>
72 * Relational.cs: The loading of true or false it's generated by
73 EmitRelationalComp not in Relational.Emit as is not always needed.
74 * CodeGenerator.cs: Add EmitRelationalComp.
75 * expression.cs (Args.Emit, emit_default_args_case): take care of
76 Relational operator case.
78 2005-09-06 Florian Gross <flgr@ccan.de>
80 * ObjectPrototype.cs: Implemented better working hasOwnProperty
81 * In.cs: Implemented JScriptIn
82 * LateBinding.cs: Added LateBinding.Delete, HasObjectProperty,
83 DirectHasObjectProperty
85 2005-09-06 Cesar Lopez Nataren <cnataren@novell.com>
87 * CodeGenerator.cs (GetBoxType): Take into account the case where
88 the type is relational whose operator is In.
90 2005-09-02 Cesar Lopez Nataren <cnataren@novell.com>
92 * SemanticAnalyser.cs: Added IsDeletable, check if a property is
93 in an object's constructor.
94 * CodeGenerator.cs: Added JSToken.Delete to GetBoxType.
95 * expression.cs: (Unary) Added field deletable. Take care of the
96 case when the property that we are trying to delete is not
97 deletable, we use late binding's method Delete for that. (Binary)
98 Added property IsDeletable. (Args) Do not pop the values of
99 arguments which implement Exp.
101 2005-08-28 Florian Gross <flgr@ccan.de>
103 * Try.cs: Implemented JScriptExceptionValue
104 * DateConstructor.cs: Adjusted rounding of date values
105 * RegExpPrototype.cs: Truncates lastIndex before using it
106 * With.cs: Implemented JScriptWith -- can't test this yet because
108 * ErrorPrototype.cs: Adjusted toString (no ClassName)
109 * JScriptCodeGenerator.cs: Implemented CreateEscapedIdentifier,
110 CreateValidIdentifier, GenerateAssignStatement, GenerateComment,
111 GenerateConditionStatement, GenerateMethodReturnStatement,
112 GenerateThisReferenceExpression, GenerateThrowExceptionStatement,
113 GenerateVariableDeclarationStatement, IsValidIdentifier,
114 QuoteSnippetString. Added dont_write_semicolon, GetSafeName,
115 FillKeywordTable, keywords. Most of this is very similar to the
116 implementation of the C# CodeGenerator
117 * DatePrototype.cs: prototype's time value is NaN, not 0
118 * Closure.cs: Sets _prototype from func
119 * FunctionObject.cs: Changed prototype of user functions
120 * ErrorObject.cs: Added GetDefaultValue
121 * GlobalObject.cs: parseFloat handles whitespace correctly.
122 Various bug fixes for parseInt
123 * RegExpObject.cs: lastindex changed to double (was int)
125 2005-08-19 Cesar Lopez Nataren <cnataren@novell.com>
127 * SemanticAnalyser.cs: Added ArrayLiteral, StringLiteral,
128 BooleanConstant, ByteConstant, ShortConstant, IntConstant,
129 LongConstant, FloatConstant, DoubleConstant to the
130 prototypes. Added methods IsNumericConstant, NeedsToBoolean.
132 * Parser.cs: Added methods InRangeOf, HasNoDecimals which help on
133 building the property AST node depending on how big and precise
136 * CodeGenerator.cs: (emit_get_default_this) Receives an extra
137 argument which indicates if we are inside a method, use
138 load_engine. Added method EmitBox, EmitConv, GetBoxType
140 * Literal.cs: Add abstract class Constant. Renamed BooleanLiteral
141 to BooleanConstant. Delete NumericLiteral, handle the number code
142 generation properly categorizing in ByteConstant, ShortConstant,
143 IntConstant, LongConstant, FloatConstant and DoubleConstant which
144 inherit from NumericConstant. (ObjectLiteral) Handle boxing issue.
146 * Statement.cs, Relational.cs: (If) Handle boxing issue.
148 * VariableDeclaration.cs: Handle the boxing issue when
149 we have initializers.
151 * Equality.cs, StrictEquality.cs: Handle the boxing issue before invoking
152 EvaluateEquality, JScriptStrictEquals.
154 * ArrayLiteral.cs: Implement ICanLookupPrototype so we can
155 optimize access to methods through the prototype and not
156 generating IL code that uses late binding. Handle the boxing
159 * expression.cs: (Unary.Emit) Nuke emit_unary_op. Take care of
160 properly boxing the operands of methods that evaluate the unary
161 operators at runtime. Fix the minus logic for IL generation, add
162 method emit_non_numeric_unary. Optimize the numeric
163 cases. (Binary) Add LateBinding internal
164 property. (Binary.emit_late_get_or_set, emit_array_access,
165 Conditional.Emit, Call.Emit, emit_print_stm, emit_late_call,
166 setup_late_call_args, EmitBuiltInArgs, Identifier.Emit, Args.Emit,
167 Expression.Emit, Assign.Emit, New.Emit)
168 Take care of properly boxing the built in .NET
169 values. (force_strong_type) Change the type from ParameterInfo to
170 object, take care specifically. (Expression) Add Last internal
171 property. In general, the point is that value types like integers,
172 booleans, etc... do not have to generate a box operation, the user
173 of the arg must handle that.
175 2005-08-17 Florian Gross <flgr@ccan.de>
177 * ScriptObject.cs: Added settable _proto for __proto__. This isn't
178 currently exposed to JScript, but set by
179 FunctionConstructor.CreateInstance. Moved AddField, ClassName,
180 proper_array_index up from JSObject
181 * Constructors: Added _length
182 * JSObject.cs: Moved AddField, ClassName, proper_array_index up to
183 ScriptObject. Added precaching of prototype fields
184 * PostOrPrefixOperator.cs: EvaluatePostOrPrefix correctly promotoes
185 old value to number. Implemented ++obj.a and obj["a"]--
186 * ActivationObject.cs: Added GetMemberValue
187 * expression.cs: Added logic for undeclared variables from cesar and
189 * ObjectPrototype.cs: toString works on ScriptObjects now
190 * JScriptException.cs: Added extra_data for adding details to the
192 * IdentificationTable.cs: Adjusted internal name mapping logic
193 * Bindings.cs: Added stubbed IsMissing
194 * JSFieldInfo.cs: Added SetValue with Binder and CultureInfo stub
195 * Convert.cs: Added IsBoolean, implemented ToString for GlobalScope
196 * LateBindings.cs: Added name, obj constructor. Heavily refactored
197 by adding GetObjectProperty, TryDirectGetObjectProperty,
198 TryGetNativeProperty, DirectSetObjectProperty, TrySetNativeProperty
199 and changed methods to use them. We now do prototypes correctly in
200 general which also slows us down. MapToInternalName does
201 substituation of $ to dollar_. Implemented a simple property cache
202 * BooleanPrototype.cs: Better implementations of toString, valueOf
203 * Parser.cs: Fixed parsing of "in" keyword in argument lists
204 * FunctionPrototype.cs: Works with all ScriptFunctions
205 * RegExpObject.cs: Added extra data to RegExpSyntax exception
206 * GlobalScope.cs: Initializes elems, removed redundant AddField
207 override and implemented stub GetField with lex level
208 * ScriptFunctions.cs: Correctly sets __proto__ on result
210 2005-08-13 Florian Gross <flgr@ccan.de>
212 * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
213 NumberConstructor.cs, FunctionConstructor.cs, BooleanConstructor.cs,
214 ArrayConstructor.cs, RegExpConstructor.cs, ErrorConstructor.cs:
216 * ScriptObject.cs: Added HasMethod, CallMethod uses
217 SemanticAnalyser.map_to_prototype and forwards engine
218 * ArrayPrototype.cs: Implemented sort, added SortHelper
219 * expression.cs: Implemented delete operator code generation
220 * NumericUnary.cs: Implemented EvaluateUnary (currently unused)
221 * ObjectPrototype.cs: smartToString falls back to toString instead
223 * StringPrototype.cs: Fixed replace logic for replacement functions
224 * FunctionDeclaration.cs: More user function infrastructure
225 * FunctionObject.cs: Implemented ToString for user functions. Moved
226 name, return_type, parameters, ToString up to ScriptFunction.
227 Constructors set _prototype
228 * Closure.cs: More user function infrastructure
229 * Convert.cs: ToString Uses smartToString if no custom toString
231 * BooleanObject.cs: Constructor now uses Convert.ToBoolean
232 * LateBindings.cs: GetMethodFlags logic for anonymous functions.
233 Initial implementation of DeleteMember. Implemented constructor
234 cases in Call and CallValue
235 * Relational.cs: Implemented EvaluateRelational, JScriptCompare
236 * Parser.cs: Fixed bugs in decompiler calls so that the decompiled
237 source code matches the original one
238 * FunctionPrototype.cs: Fixed toString function check
239 * Decompiler.cs: Adjusted indent properties. Made AddEOL not add
240 semicolons to lines which already end with one. Implemented double
242 * SemanticAnalyser.cs: Added more prototype mappings
243 * ErrorConstructor.cs: Added ErrorTypeToName
244 * FunctionExpression.cs: More user function infrastructure
245 * ScriptFunction.cs: Added vsa_engine. Moved name, return_type,
246 parameters, encodedSource, ToString up from FunctionObject.
247 Implemented CreateInstance. Added initial setter for prototype.
248 Added GetDefaultValue
250 2005-08-09 Florian Gross <flgr@ccan.de>
252 * BitwiseBinary.cs: Implement LeftShift, RightShift and
253 UnsignedRightShift evaluation. Add method UnsignedRightShift.
254 * Token.cs: Added field PrintNames, Add flag ignore_error to
256 * Decompiler.cs: Fixes for >>> implementation. Clean up the port.
258 2005-08-09 Cesar Lopez Nataren <cnataren@novell.com>
260 * Parser.cs: Added infrastructure for closure construction support
261 per Florian Gross and Miguel request ;-)
262 * Decompiler.cs: Added to the repository.
264 2005-08-04 Jb Evain <jbevain@gmail.com>
266 * CodeGenerator.cs: write a valid RequestAttribute on the assembly
268 2005-08-03 Florian Gross <flgr@ccan.de>
270 * ScriptObject.cs: Renamed __proto__ to proto for 1.1 compatibility
271 * expression.cs: Uses LateBinding.MapToInternalName to map __proto__
273 * StringPrototype.cs: replace doesn't use anonymous delegate anymore
274 for 1.1 compatibility
275 * JScriptException.cs: Added another case to ErrorMessage.
276 * IdentificationTable.cs: Uses LateBinding.MapToInternalName to map
278 * LateBinding.cs: Added MapToInternalName and changed code to use it.
279 Fixed type mapping with varargs. Unwraps Closure objects to
280 FunctionObjects. Fixed bug in SetField logic
281 * JSObject.cs: Added ClassName for RegExpObject
282 * ArrayPrototype.cs: More uint / int fixes for concat, splice,
284 * StringConstructor.cs: String() ought to be "undefined"
285 * JScriptException.cs: Added code for user exceptions (eg. throw "x")
286 * FunctionObject.cs: Implemented length for user functions
287 * Convert.cs: uint / uint fix for Convert.ToNativeArray
288 * Throw.cs: Implemented JScriptThrow
289 * FunctionPrototype.cs: Correctly throws JSError.FunctionExpected
290 instead of NotImplementedException
291 * ScriptFunction.cs: Added arity as an alias for length (Mozilla)
293 2005-08-02 Cesar Lopez Nataren <cnataren@novell.com>
295 * TokenStream.cs: Display source name and line number.
296 * SemanticAnalizer.cs: Added StringLiteral to prototypes.
297 * Parser.cs: Added Location class, which tracks the SourceName and
298 line number. Build every node from the AST tree with location info.
299 * CodeGenerator.cs: Add emit_default_value.
300 * expression.cs: (Binary.Resolve) Fix for calling directly the
301 method from the prototype if the lhs binary expression is a
302 literal, added ICanLookupPrototype interface. Display the source
303 file name and line number in the errors. (Call) Added field
304 need_this, simplify the logic infering the exact number of
305 parameters from the called method. Added NeedThis. Re-implement
306 Resolve and Emit from Args, delete DesiredNumOfArgs, IsPrint,
307 has_var_args. Added Size, emit_default_args_case. Added location
308 field to FunctionObject. StringLiteral implements ICanLookupPrototype.
309 Fix typo from IAccessible :).
311 * All classes that inherit from abstract class AST: Use
312 constructor from AST that stores the parent and the new info from
315 2005-08-01 Cesar Lopez Nataren <cnataren@novell.com>
317 * Statement.cs (Catch.Emit): Fix for properly emit code for
318 loading the script engine.
320 2005-07-29 Cesar Lopez Nataren <cnataren@novell.com>
322 * All files at current dir: set svn:eol-style to native.
324 2005-07-28 Florian Gross <flgr@ccan.de>
326 * DateConstructor.cs: Sets _prototype. Added DateMod. MakeDay,
327 IsLeapYear, DaysInYear, WeekDay, HourFromTime, MinFromTime,
328 SecFromTime, msFromTime use DateMod (important for negative date
330 * ScriptObject.cs: Added implementation of proprietary __proto__
331 * JSObject.cs: Added more ClassName cases and fixed old ones.
332 GetDefaultValue uses smartToString instead of toString
333 * ArrayPrototype.cs: Added Proto. Switched indices and length values
334 to use uint instead of int so we can represent the full Array size
336 * StringConstructor.cs: Sets _prototype
337 * ObjectConstructor.cs: Sets _prototype
338 * RegExpPrototype.cs: Added Proto. Uses uint instead of int for
339 RegExpMatch length and indices
340 * NumberConstructor.cs: Sets _prototype
341 * expression.cs: force_strong_type always uses ToNumber (fixes
342 broken arguments for Math.pow and so on)
343 * ObjectPrototype.cs: Added Proto. toString is dumb and will output
344 [object Array] when called on an Array instead of using
345 ArrayPrototype.toString. Added smartToString which does the old
347 * StringPrototype.cs: Added Proto. Uses uint instead of int for
349 * JScriptException.cs: Added more cases to Message
350 * ArrayObject.cs: Switched to uint for indices and length
351 * FunctionConstructor.cs: Sets _prototype
352 * Equality.cs: Rewrote equality logic. More cases covered, less code
353 * DatePrototype.cs: Added Proto
354 * Convert.cs: Added ToUint32. ToNumber with Arrays switched to uint
355 * StrictEquality.cs: Added logic for function equality
356 * StringObject.cs: Initializes value to "". Implemented Equals
357 * LateBinding.cs: More cases covered. Added logic for converting
358 arguments to match the signature. Added SetArrayLength. Refactored
359 to use SetArrayLength
360 * BooleanPrototype.cs: Added Proto and empty implementation of
362 * BooleanConstructor.cs: Sets _prototype
363 * FunctionPrototype.cs: Added Proto
364 * NumberPrototype.cs: Added Proto
365 * ArrayConstructor.cs: Sets _prototype
366 * SemanticAnalizer.cs: Added constructor and prototype information
367 to prototypes lookup table
368 * RegExpConstructor.cs: Sets _prototype
369 * ScriptFunction.cs: Added _prototype and implemented prototype
370 using it. Implemented Equals for built-in functions
372 2005-07-28 Cesar Lopez Nataren <cnataren@novell.com>
374 * expression.cs (emit_access): Take into account that __proto__
375 property (Mozilla extension) is contained in ScriptObject.
377 2005-07-27 Cesar Lopez Nataren <cnataren@novell.com>
379 * SemanticAnalizer.cs: Added Boolean/BooleanConstructor and
380 Function/FunctionConstructor. Delete method Dump.
382 2005-07-25 Cesar Lopez Nataren <cnataren@novell.com>
384 * SemanticAnalizer.cs: Added Object/ObjectConstructor to the obj_ctrs.
385 * expression.cs: Fixes error for cases like Constructor.Property.
386 * SemanticAnalizer.cs: Added Array/ArrayConstructor to the ctrs.
388 2005-07-25 Marek Safar <marek.safar@seznam.cz>
390 * IdentificationTable.cs: Fixed build.
392 2005-07-24 Florian Gross <flgr@ccan.de>
394 * DateConstructor.cs: CreateInstance handles Infinity, NaN and double
395 with decimal places correctly and won't fail when trying to get the
396 timezone offset for invalid values anymore. LocalTime keeps the date
397 in the correct timezone
398 * ScriptObject.cs: Moved GetField from JSObject.cs. CallMethod can be
399 used to call ObjectPrototype methods on objects of derived prototypes.
400 * JSObject.cs: Implemented SetMemberValue2, more cases for ClassName,
401 added avoid_toString argument to GetDefaultValue to avoid infinite
402 recursion from ObjectPrototype:toString
403 * ArrayPrototype.cs: Fixed pop, shift to work with the auto-popping
404 ArrayObject:length setter. Implemented toLocaleString
405 * ObjectConstructor.cs: Refactored to use Convert.ToObject. Invoke
406 works with null / undefined argument
407 * StringConstructor.cs: Handles Object []
408 * RegexpPrototype.cs: exec made aware of $_ and UpdateLastMatch
409 * JScriptInstanceOf.cs: Implemented JScriptInstanceof
410 * NumberConstructor.cs: Handles Object []
411 * ObjectPrototype.cs: toString uses GetDefaultValue if available
412 * StringPrototype.cs: match uses UpdateLastMatch, replace works with
413 replacement function, split handles max_count correctly in all cases
414 and calls UpdateLastMatch and handles no match case correctly
415 * IdentificationTable.cs: CreateSymbol mangles "$" to "dollar_" so
416 we can support RegExp.$1, Enter handles case where symbol exists
417 already so that function foo (a, b, a) { } works
418 * ArrayObject.cs: length setter pops elements if new size < old size
419 * ErrorPrototype.cs: Implemented constructor, toString
420 * JSFieldInfo.cs: Implemented Name
421 * DatePrototype.cs: Made toDateString, toLocaleDateString,
422 toLocaleString, toLocaleTimeString, toString, toUTCString handle
423 invalid date value cases
424 * NumericBinary.cs: Refactored to use Convert.ToNumber
425 * Convert.cs: Refactored ToBoolean, ToInt32, ToNumber, ToObject to
426 use IsNumberTypeCode. Added more object cases to ToNumber. ToNumber
427 with string correctly choses parseInt or parseFloat instead of always
428 using parseFloat. Implemented ToNativeArray. Added more cases to
429 ToObject. Fixed ToString with double to be more standards conform
430 * StringObject.cs: Implemented length getter
431 * LateBinding.cs: Added GetMethodFlags, GetRequiredArgumentCount.
432 Made assemble_args ignore trailing unneeded arguments and handle
433 methods that don't have a thisObj argument. Added Invoke logic for
434 Closure, FunctionObject and RegExpObject. Made GetNonMissingValue
435 work correctly for GlobalScope. Correctly sets length when adding
436 index properties to ArrayObjects. Implemented SetValue
437 * GlobalObject.cs: Implemented escape, Function, unescape. Made
438 parseFloat ignore some leading / trailing garbage
439 * FunctionPrototype.cs: Implemented apply, call
440 * RegExpObject.cs: ToString handles empty RegExp case correctly.
441 Initialize made aware of $*. Implemented GetDefaultValue
442 * TokenStream.cs: Handle overflows from float literals
443 * ErrorConstructor.cs: Added ErrorTypeToClass, implemented
445 * RegExpConstructor.cs: RegExpConstructor adds fields for $_,
446 $&, $+, $`, $', $*. Added UpdateLastMatch. Invoke handles zero
447 argument case. Added getters for $1 to $9. Implemented input,
448 lastMatch, lastParen, leftContext, rightContext, multiline
449 * ScriptFunction.cs: Implemented length getter and setter
451 * SyntaxErrorObject.cs, ReferenceErrorObject.cs,
452 TypeErrorObject.cs, ErrorObject.cs, EvalErrorObject.cs,
453 RangeErrorObject.cs, URIErrorObject.cs: Added new ctr, which is used at
454 ErrorConstructor::CreateInstance.
456 * expression.cs: Use Missing.Value for missed parameters in method
459 2005-07-17 Florian Gross <flgr@ccan.de>
461 * DateConstructor.cs: Implemented UTC
462 * ScriptObject.cs: Implemented GetMethod, CallMethod
463 * JSObject.cs: Implemented fallback ToString, more ClassName cases and
464 fallback GetDefaultValue
465 * ArrayPrototype.cs: Fixed concat, join and added splice
466 * RegExpPrototype.cs: Implemented compile, exec, test
467 * expression.cs: Emit JS undef instead of JS null for missing args.
468 * StringPrototype.cs: changed lastIndexOf to be compatible with JSC.
469 Implemented match, replace (no replacement closure), search, split.
470 No longer uses assert_type for ensuring right type of thisObj
471 * ArrayObject.cs: Better length argument handling in constructor. Added
473 * DatePrototype.cs: Added setDate, setFullYear, setHours, setMinutes,
474 setMilliseconds, setMonth, setSeconds, setTime, setUTCDate,
475 setUTCFullYear, setUTCHours, setUTCMinutes, setUTCMilliseconds,
476 setUTCMonth, setUTCSeconds, setYear
477 * FunctionObject.cs: Moved MethodAttributes to ScriptFunction. Added
478 MethodInfo-taking constructor
479 * Convert.cs: Added IsNumber, IsString, ToRegExp. More cases in
480 ToNumber. Refactored ToString
481 * ScriptEquality.cs: More cases
482 * LateBindings.cs: Big refactoring. Introduced assemble_args. Handles
483 missing arguments. build_args can pass null as engine. More CallValue,
484 GetNonMissingValue cases
485 * Plus.cs: Heavily refactored EvaluatePlus from 90 to 12 lines
486 * GlobalObject.cs: Added CollectGarbage
487 * NumberPrototype.cs: No longer uses assert_type for unsuring right
489 * RegExpObject: Added lastIndex, Initialize, stores compiled Regex
490 * SemanticAnalizer: Added missing prototypes. Made assert_type work
492 * ScriptFunction.cs: Moved MethodAttributes from FunctionObject. Added
493 MethodInfo. Implemented Invoke for built-in functions.
495 2005-07-07 Florian Gross <flgr@ccan.de>
497 * MathObject.cs: Implemented max and min (untested)
498 * ObjectConstructor.cs: Implemented Invoke
499 * StringConstructor.cs: Implemented Invoke and fromCharCode
500 * PostOrPrefixOperator.cs: Implemented EvaluatePostOrPrefix
501 * NumberConstructor: Implemented CreateInstance and Invoke
502 * expression.cs: Implemented unary operators void, +, -, !, ~ and !
503 * ArrayPrototype.cs: Implemented concat, push and unshift
504 * DatePrototype.cs: Implemented getDate, getDay, getFullYear, getHours,
505 getMilliseconds, getMinutes, getMonth, getSeconds, getTime,
506 getTimezoneOffset, getUTCDate, getUTCDay, getUTCFullYear, getUTCHours,
507 getUTCMilliseconds, getUTCMinutes, getUTCMonth, getUTCSeconds,
508 getVarDate, getYear, toDateString, toGMTString, toLocaleDateString,
509 toLocaleString, toLocaleTimeString, toString, toTimeString,
510 toUTCString and valueOf
511 * ObjectPrototype.cs: Implemented toLocaleString and valueOf
512 * StringPrototype.cs: Implemented substr and concat
513 * Convert.cs: Implemented ToPrimitive, ToBoolean and ToUint16. Added
514 more cases to IsNumberTypeCode, IsFloatTypeCode and ToInt32. Fixed
515 ToString with doubles
516 * Plus.cs: Added more cases. Fixed endless loop for unknown types via
518 * ArrayObject.cs: Added GetDefaultValue
519 * NumberObject.cs: Added GetDefaultValue
520 * StringObject.cs: Added GetDefaultValue
521 * BooleanObject.cs: Added GetDefaultValue
522 * GlobalObject.cs: Fixed parseFloat. Added parseInt and ScriptEngine*
524 * JSObject.cs: Implemented abstract GetDefaultValue
525 * BitwiseBinary.cs: Implemented &, ^ and | operators
526 * BooleanConstructor.cs: Implemented Invoke
527 * DateConstructor.cs: Implemented infrastructure for DatePrototype.
528 Note: YearFromTime is ported from Rhino. Also implemented Invoke and
530 * NumberPrototype.cs: Implemented toFixed, toLocaleString and toString
531 * TokenStream.cs: Fixed locale dependant float parsing
532 * LateBinding.cs: Added proper support for varargs passing
534 2005-07-06 Cesar Lopez Nataren <cnataren@novell.com>
536 * FunctionExpression.cs (build_closure): Use CodeGenerator.load_engine.
538 * Parser.cs: Restore pn as the parent.
539 * expression.cs: Added is_dynamic_function field to class
540 Call. It's not enough knowing if the parent is a
541 FunctionExpression/FunctionDeclaration, we must assure that we
542 are really inside a FunctionExpression/FunctionDeclaration in
543 order to know in which place is the engine. setup_late_call_args
544 and get_global_scope_or_this used the new field for loading the
547 2005-07-05 Cesar Lopez Nataren <cnataren@novell.com>
549 * LateBinding.cs (CallValue): throw a NotImplementedException
550 instead of a returning null.
553 * FunctionExpression.cs (Emit): use InFunction instead of testing by hand.
554 * Parser.cs (MemberExpr): pass parent as the parameter not pn.
555 * expression.cs (get_global_scope_or_this): use
556 CodeGenerator.load_engine for loading the engine, and invoke
557 GetGlobalScope when the member_exp is a function expression.
559 2005-07-04 Cesar Lopez Nataren <cnataren@novell.com>
562 * expression.cs (emit_late_get_or_set, emit_late_call): Take care the case where
563 the left hand side of a late bound expression is a literal.
564 * SemanticAnalizer.cs: Added IsLiteral method.
566 2005-07-02 Florian Gross <flgr@ccan.de>
568 * ArrayPrototype.cs: Implemented pop, reverse, shift and slice
569 * StringPrototype.cs: Implemented anchor, big, blink, bold, charAt,
570 charCodeAt, fixed, fontcolor, fontsize, indexOf, italics, lastIndexOf,
571 link, localeCompare, slice, small, strike, substring, sup,
572 toLocaleLowerCase, toLocaleUpperCase, toLowerCase, toString, toUpperCase
574 * ArrayObject.cs: ArrayObject-ctor works correctly when first argument
575 isn't length and first element gets assigned to 0 slot correctly
576 * NumberObject.cs: Basic constructor / double value made internal
577 * Equality.cs: Added basic logic for TypeCode.Empty, DBNull, Boolean and
579 * FunctionObject.cs: ToString matches that of MS JS.NET for internal
581 * Convert.cs: IsNumberTypeCode and IsFloatTypeCode utility methods, basic
582 implementation of ToInt32 and ToNumber, more cases for ToString
583 * StrictEquality.cs: Initial working implementation
584 * LateBindings.cs: Call works for Methods that don't have HasEngine and
585 support for getting methods (as in "foo".link) in GetNonMissingValue
586 * Plus.cs: Added support for more types
587 * GlobalObject.cs: Implemented isNaN, isFinite and parseFloat
588 * FunctionPrototype.cs: Implemented toString
589 * NumberPrototype.cs: Implemented valueOf
590 * Globals.cs: Implemented ConstructArrayLiteral
591 * TypeOf.cs: Added more cases
593 2005-06-10 Cesar Lopez Nataren <cnataren@novell.com>
595 * LateBinding.cs: Added field right_hand_side. Initial
596 implementation of Call. Added build_args method. Initial
597 implementation of GetNonMissingValue.
598 * Convert.cs (ToObject): Add return values for TypeCode.String,
599 TypeCode.Boolean, and TypeCode.Object.
600 * RegExpPrototype.cs (toString): Implemented.
601 * RegExpObject.cs: Implemented.
602 * RegExpConstructor.cs: Implement Construct, CreateInstance, and Invoke.
604 2005-06-06 Cesar Lopez Nataren <cnataren@novell.com>
606 * expression.cs (emit_access): We can now access the properties
607 from the Global RegExp object, they were not being accesible
608 because they are properties not fields.
610 2005-05-31 Cesar Lopez Nataren <cnataren@novell.com>
612 * SemanticAnalizer.cs: Add the global, non-constructable RegExp
613 constructor object to obj_ctrs so we can type-check its property
614 access as well as fixing the break showed at #74681 now the raise
615 the proper error code. Renamed method object_contains_method to
616 object_contains, and now we filter on instance members too.
617 * expression.cs: use new API from SemanticAnalizer.
619 2005-05-30 Cesar Lopez Nataren <cnataren@novell.com>
621 * Literal.cs: (RegExpLiteral.Emit): Take care of attributes. "g" is
622 global, "i" is case-insensitive and "m" is multi-line.
624 2005-05-19 Cesar Lopez Nataren <cnataren@novell.com>
626 * Parser.cs: Throw NotImplementedException for function
627 declarations that appear inside other statements
628 (FunctionType.ExpressionStatement declarations). Fix the
629 NullReferenceException from #74970. But now exposes #75002.
631 2005-05-18 Marek Safar <marek.safar@seznam.cz>
633 * JScriptCodeGenerator.cs: Stubbed.
635 * JScriptCodeProvider.cs: Implemented.
637 2005-05-17 Cesar Lopez Nataren <cnataren@novell.com>
639 * SemanticAnalizer.cs: Add methods_with_outter_scope_refs and
640 methods_with_vars_used_nested hashtables.
641 AddMethodReferenceOutterScopeVar, AddMethodVarsUsedNested,
642 MethodReferenceOutterScopeVar. OutterScopeVar,
643 MethodVarsUsedNested and VarUsedNested.
644 * CodeGenerator.cs: Add locals_to_stack_frame method and emit_parents.
645 * TypeManager.cs: Add LocalsAtDepth.
646 * VariableDeclaration.cs: keep track of the lexical depth of
648 * FunctionDeclaration.cs: take care of outter scope variables uses.
649 * IdentificationTable.cs: keep track of Catch statement opened blocks.
650 * expression.cs: take care of eval's Net_1_0 and greater
651 versions. Implement the use of variables in nested scopes. For it,
652 we track the variable's scope level and we compare it with the
653 level in which appears if there's a difference supperior to one
654 and the variables wasn't not declared in the global scope we
655 proceed to generate the code that keep tracks of the state of the
656 variables through a StackFrame, in which we copy the local vars
657 prior to the invocation to the nested method which uses a outter
658 scope variable, then we copy back the variables in the StackFrame
659 into de local vars when the invocation finishes.
661 * Try.cs: open a scope indicating that's for a catch block.
663 2005-05-07 Cesar Lopez Nataren <cnataren@novell.com>
665 * MethodInvoker.cs, ScriptObject.cs, BitwiseBinary.cs,
666 ActivationObject.cs, PostOrPrefixOperator, StackFrame.cs,
667 NumericUnary.cs, JSConstructor.cs, Equality.cs, NumericBinary.cs,
668 Convert.cs, LateBinding.cs, Plus.cs, BitwiseBinary.cs,
669 JSMethodInfo.cs, Relational.cs, ScriptFunction.cs : Add missing
672 2005-05-06 Cesar Lopez Nataren <cnataren@novell.com>
674 * Binding.cs: add missing methods and fields.
676 2005-05-03 Cesar Lopez Nataren <cnataren@novell.com>
678 * ReturnOutOfFinally.cs, SyntaxErrorObject.cs, TypeReflector.cs,
679 JSPrototypeObject.cs, ReferenceErrorObject.cs, Namespace.cs,
680 expression.cs (Unary class), Binding.cs, ArrayWrapper.cs,
681 CmdLineOptionParser.cs, TypeErrorObject.cs, JSConstructor.cs,
682 TypedArray.cs, FunctionWrapper.cs, SuperTypeMembersSorter.cs,
683 ContinueOutOfFinally.cs, BlockScope.cs,
684 AssemblyCustomAttributeList.cs, VersionableAttribute.cs,
685 SimpleHashtable.cs, ResInfo.cs, Import.cs,
686 NotRecommendedAttribute.cs, CmdLineException.cs, DebugBreak.cs,
687 VBArrayObject.cs, CmdLineError.cs, TODOAttribute.cs,
688 RegExpMatch.cs, JScriptCodeProvider.cs, RangeErrorObject.cs,: Fixes for API compliance.
690 2005-04-28 Cesar Lopez Nataren <cnataren@novell.com>
692 * BinaryOp.cs, ActivationObject.cs, expression.cs (Args),
693 ArrayLiteral.cs, ArrayObject.cs, IRedirectOutput.cs, ASTList.cs,
694 IVsaScriptScope.cs, ast.cs (AST), BinaryOp.cs,
695 EnumeratorObject.cs, BreakOutOfFinally.cs, Enum.cs,
696 FormalParameterList.cs, FunctionDeclaration.cs, Equality.cs,
697 Closure.cs, Block.cs, Statement.cs, BooleanObject.cs,
698 LenientBooleanPrototype.cs, GlobalObject.cs, BooleanPrototype.cs,
699 CodeGenerator.cs, LenientDateConstructor.cs,
700 LenientGlobalObject.cs, JSToken.cs, MethodInvoker.cs,
701 LenientRegExpPrototype.cs, NumericUnary.cs,
702 LenientArrayPrototype.cs, JSParser.cs, JSPropertyInfo.cs,
703 LenientVBArrayPrototype.cs, LenientStringPrototype.cs,
704 LenientObjectPrototype.cs, With.cs, ScriptBlock.cs, Expando.cs,
705 JSScanner.cs, LenientEnumeratorPrototype.cs, EvalErrorObject.cs,
706 VariableDeclaration.cs, Print.cs, LenientErrorPrototype.cs,
707 LenientBooleanPrototype.cs, LenientFunctionPrototype.cs, Literal.cs,
708 LenientMathObject.cs, LenientDatePrototype.cs, Relational.cs,
709 Parser.cs, Throw.cs, VariableStatement.cs, RegExpObject.cs, Eval.cs,
710 SemanticAnalizer.cs, LenientStringConstructor.cs,
711 LenientNumberPrototype.cs, FieldAccessor.cs : Changes for MS API
714 2005-04-18 Cesar Lopez Nataren <cnataren@novell.com>
716 * Parser.cs: Build a StrictEquality object instead of a Equality
717 object, when we have === and !=== as operator.
718 * CodeGenerator.cs: (ft_emit_equality, fall_true) Take into account the
719 strict cases of equality.
720 * StrictEquality.cs: Add parent, left and right params to default
721 ctr. Implement Resolve and Emit.
723 2005-04-15 Cesar Lopez Nataren <cnataren@novell.com>
725 * Statement.cs: make internal the builders.
726 * expression.cs: (Identifier.Emit) Take into account if its
727 binding is of type Catch.
729 2005-04-14 Cesar Lopez Nataren <cnataren@novell.com>
731 * SemanticAnalizer.cs: Added a Hashtable that indicates which
732 methods need to generate proper code for handling the local vars
733 in the StackFrame. Added method AddMethodWithEval, MethodContainsEval.
735 * Eval.cs: Back to M.J.
737 * ast.cs: locals from abstract class Function is now an array of
738 objects not just AST's.
740 * CodeGenerator.cs: Clean up fall_true, better using recursion :)
741 Added static method load_local_vars. At method ft_emit_equality do
742 Emit the code of the ast. Added method load_local_vars.
744 * FunctionDeclaration.cs: Update call to TypeManager methods to
745 new API. Added a check for invocations to 'eval' inside functions
746 so StackFrame IL code gets generated. Build the function's closure
747 take the need for the StackFrame into account.
749 * TypeManager.cs: renamed IdentificationTable locals to
750 local_script_functions, AddLocal to AddLocalScriptFunction,
751 GetLocal to GetLocalScriptFunction. Added method CurrentLocals.
753 * IdentificationTable.cs: Method CurrentLocals now returns
754 an array of object's not AST's.
756 * expression.cs: (class Call) Check if we have a call to 'eval',
757 if so we must keep up the StackFrame which contains the local
758 vars. We generate special code that handles the StackFrame with
759 the local vars in order to keep them in sync. When a function
760 contains an invocation to 'eval' even when such function is a
761 function declared in the code we do not perform a direct method
762 call to it when invoked instead a call through late binding gets
763 performed. Added methods IsEval, set_local_vars. Implement 'eval'
766 2005-04-10 Cesar Lopez Nataren <cnataren@novell.com>
768 * StackTrace.cs: Back to M.J namespace.
770 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
772 * Literal.cs: fix the build and broke something else ;-).
774 2005-04-08 Cesar Lopez Nataren <cnataren@novell.com>
776 * Literal.cs: Implement the construction of regular expression literal.
777 * Parser.cs: Pass the proper parent to RegExpLiteral.
779 2005-03-30 Cesar Lopez Nataren <cnataren@novell.com>
781 * TypeOf.cs: take into account Objects.
782 * ArrayConstructor.cs: Implement CreateInstance.
783 * LateBinding.cs: Initial implementatio of CallValue and
784 SetIndexedPropertyValueStatic.
785 * JSFieldInfo.cs: Implement GetValue and SetValue.
786 * ArrayObject.cs: Implement length, add three ctrs.
787 * JScriptException.cs: Add error_number field. Implement
788 ctr. ErrorNumber, Message and StackTrace.
789 * ArrayPrototype.cs: Implement join and toString.
790 * JSObject.cs: Remove the ChainHash, we use a simple hashtable
791 now, the one inherited from ScriptObject.
792 * ScriptObject.cs: Add a Hashtable here.
794 2005-03-29 Cesar Lopez Nataren <cnataren@novell.com>
796 * GlobalScope.cs: Set parent and engine in ctr. Return 'this' for
797 GetDefaultThisObject.
798 * ScriptObject.cs: Added protected 'parent' field of type
801 2005-03-16 Cesar Lopez Nataren <cnataren@novell.com>
803 * FunctionExpression.cs: Update to TypeManager new API.
805 * TypeManager.cs: Keep both MethodBuilder and LocalBuilder around.
807 * FunctionDeclaration.cs: In some contexts we need the
808 MethodBuilder and LocalBuilder, so we must keep both around.
810 * expression.cs: (load_script_func) Take care if bounded variable
811 was declared in a nested context. (emit_create_instance) Handle
812 the FunctionConstructor case.
814 2005-02-28 Cesar Lopez Nataren <cnataren@novell.com>
816 * ForIn.cs: Initial implementation of ForIn stm.
818 2005-02-27 Cesar Lopez Nataren <cnataren@novell.com>
820 * VariableStatement.cs (PopulateContext): Do not add the symbol to
821 the context if already defined in current context.
823 * CodeGenerator.cs: Renamed VariableDefined to variable_defined_in_current_scope.
825 * TypeManager.cs: Reimplemented it, We use an IdentificationTable
826 instead of a simple Hashtable so we can handle scopes
827 properly. Cleaner api.
829 * VariableDeclaration.cs: Use new CodeGenerator api. (EmitDecl)
830 Add the builders to the TypeManager.
832 * Block.cs: Use new TypeManager api.
834 * FunctionDeclaration.cs: Use new TypeManager api. Take care of
835 scopes in the TypeManger on Emit.
837 * IdentificationTable.cs: (Binder) Changed the type of value from
838 AST to object so I can use this symbol table
839 anywhere. (IdentificationTable) Add current_locals stack and added
840 method InCurrentScope.
842 * expression.cs: Use new api from TypeManager, Add casts where neeeded.
844 This solves an infinite loop we were falling into when calling
845 IdentificationTable.CurrentLocals when repeated declarations where
846 inside function declarations.
848 * ast.cs: Added protected field ig to class Function.
849 * Block.cs: Emit function's body in a later phase since free
850 ocurrences of functions - at the same level of it - can be handled
851 properly, since they must be defined and inited to the correct values.
852 * FunctionDeclaration.cs: Renamed Emit to create_closure. And make
853 Emit only generate the code of the body.
857 2005-02-22 Cesar Lopez Nataren <cnataren@novell.com>
859 * Block.cs: Report error JS5040. Reopened #72674, see last comment of it.
861 * CodeGenerator.cs: Added method VariableDefined.
863 * TypeManager.cs: Added method SetMethod.
865 * VariableDeclaration.cs (EmitDecl): Added logic to allow multiple
866 declarations of the same var. Fixes #72674.
868 * Block.cs: Added hashtable ocurrences. It holds the index of the
869 previous declaration which after encountering another one with the
870 same name gets nuked.
872 * FunctionDeclaration.cs: Added logic for allowing multiple
873 declaration of methods with the same name. Fixes #72674.
875 * expression.cs (Args): Added field func. Holds a reference to the
876 Function which to the args are being passed. Use it to track the
877 proper number of arguments for the call.
879 2005-02-20 Cesar Lopez Nataren <cnataren@novell.com>
881 * expression.cs (Args.Emit): check if num_of_args is -1.
882 * ast.cs (Function.NumOfArgs): avoid using a null pointer. In the
883 code generation phase if num_of_args is -1 means the actual
884 arguments are the desired number of args. Fixes #72697.
886 * Parser.cs: Pass proper parent.
887 * CodeGenerator.cs: added emit_get_default_this.
888 * Literal.cs (This) : Resolve and Emit implemented. Fixes #72477
889 * expression.cs: (emit_late_get_or_set) use
890 load_engine. (load_script_func) Ensure that TypeManager has a ref
891 to the local otherwise it's a field. (New.Resolve) Check if late
892 binding is needed. (New.Emit) Generate proper IL that make use of
893 late binding when the id of the constructor it's not part of the
896 2005-02-14 Cesar Lopez Nataren <cnataren@novell.com>
898 * Token.cs, TokenStream.cs, Parser.cs: make this classes internal.
900 * Context.cs: delete wrongly exposed ctr.
902 2005-02-10 Cesar Lopez Nataren <cnataren@novell.com>
904 * expression.cs: use InFuntion in proper places.
906 * Parser.cs: Add parameter that indicates if it's a prefix
907 operator. When building the MemberExprTail set to proper parent.
908 * PostOrPrefixOperator.cs: Partial implementation of ++ and --,
909 prefix and suffix, we assume that the operand is a variable.
911 2005-02-09 Cesar Lopez Nataren <cnataren@novell.com>
913 * expression.cs: Added method EmitStore and EmitLoad to Identifier
914 class. Implemented op= operators. Fixes 72393.
916 2005-02-08 Cesar Lopez Nataren <cnataren@novell.com>
918 * expression.cs (Identifier.Emit): Handle case where we are
919 assigning to a formal parameter. Fixes #72333.
921 2005-02-06 Cesar Lopez Nataren <cnataren@novell.com>
923 * expression.cs: (load_script_func) Load localbuilder in an
924 invocation when needed, this let us have higher order functions,
925 which is lovely (Fixes #71129). Update calls to load_engine to new signature.
926 * FunctionDeclaration.cs: Add LocalBuilder to TypeManager.locals
927 * Statement.cs: Changed ctr to Init, so we can track correctly the
928 parent hierarchy when building the ast of the program.
929 * TypeManager.cs: Added field locals. Factored code for
930 handling the tables. Added enums ManagedType and Operation.
931 * Parser.cs: Track correctly the parent of return.
932 * ast.cs (class Function): add ScriptBlock as possible parent of a
934 * CodeGenerator.cs: change signature of load_engine. Instead of a
935 AST a boolean. So we can call it with InFunction as parameter.
937 2005-02-05 Cesar Lopez Nataren <cnataren@novell.com>
939 * expression.cs: rework the late binding algorithm, we directly
940 call an object's method if it's a static method of it. Added field
941 late_bind, properties AccessField and Binding, renamed emit_access
942 to emit_array_access to class Binary. Added fields params_info,
943 late_bind and var_args to Class Args; also methods has_var_args,
944 force_strong_type, reworked its Emit code, we take care of methods
945 which have variable number of arguments, take care of needed
946 conversions and boxing when the call has specific strong types as
947 formal parameters. Added method IsPrint and property Parameters to
949 * IdentificationTable.cs: Better implementation of jscript's
950 environments semantics. Added classes Symbol and Binder.
951 * SymbolTable.cs: Nuked.
952 * Block.cs: Fix the semantic of semantic analysis and code
953 generatipo process, we now allow forward declarations of variables
955 * FunctionDeclaration.cs: Added default ctr and Init method. Fix
956 the semantics of the Resolve and Emit process, we can have forward
957 declaration of variables and functions. Fix order in which
958 JSLocalField's get build.
959 * FunctionExpression.cs: Fix order in which JSLocalField's get build.
960 * VariableStatement.cs: Added methods EmitVariableDecls and PopulateContext.
961 * VariableDeclaration.cs: Added method EmitDecl. Delay the Resolve
962 and Emit process until the second phase.
963 * Statement.cs: Resolve process of For class take care of
964 VariableStatements for populating the environment in advance.
965 * TypeManager.cs: Make GetMethod return a MethodBuilder.
966 * ast.cs: Added field locals, property NumOfArgs, method GetName
967 to abstract class Function.
968 * SemanticAnalyser.cs: unified global environment and the stack of
969 contexts. Added field global_obj, adapt methods to new
970 IdentificationTable api. Delete method ObjectSystemContains. Added
971 method contains, is_js_object, object_contains_method, map_to_ctr,
973 * Try.cs: Update to new IdentificationTable api.
974 * ScriptObject.cs, JSPropertyInfo.cs, FormalParameterList.cs,
975 JSFieldInfo.cs, JSMethodInfo.cs, JSLocalField.cs,
976 ScriptFunction.cs: use full namespace name for Binder.
978 2005-01-17 Cesar Lopez Nataren <cnataren@novell.com>
980 * CodeGenerator.cs: Added load_engine.
981 * expression.cs (emit_func_call), FunctionDeclaration.cs: Fix
982 computation of VsaEngine.
984 2005-01-11 Cesar Lopez Nataren <cnataren@novell.com>
986 * StringConstructor.cs: implement CreateInstance.
988 2005-01-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
990 * BooleanPrototype.cs: update to assert_type.
991 * SemanticAnalizer.cs: move BooleanPrototype.AssertType here, rename it to assert_type.
993 2005-01-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
995 * BooleanObject.cs: implement ctr's.
996 * BooleanPrototype.cs: back to M.J namespace. Implement contructor
997 property, toString and valueOf, add AssertType.
999 * Convert.cs: add ToString overload and implement.
1001 * JSFieldInfo.cs, JSLocalField.cs: Add conditional NET_2_0 or BOOTSTRAP_NET_2_0 's
1002 Mono_GetGenericFieldDefinition.
1004 * StringObject.cs: add ctrs.
1006 2005-01-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1008 * ObjectPrototype.cs: Add internal ctr. Implement hasOwnProperty.
1009 * ObjectConstructor.cs: implemented CreateInstance.
1010 * expression.cs (emit_create_instance): add Boolean case.
1011 * Try.cs, Statement.cs (EmitStms), Literal.cs
1012 (ObjectLiteralItem.Emit), CodeGenerator.cs (fall_false): delete
1015 2004-12-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1017 * CodeGenerator.cs: add support for compiling not only from cwd.
1019 2004-12-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1021 * expression.cs: emit code for null literal.
1023 2004-12-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1025 * expression.cs: added StringConstructor case.
1027 * MemberInfoList.cs: added internal classes Node, ListIter,
1028 ChainHash and implement MemberInfoList.
1029 * JSObject.cs: implement AddField, AddProperty, AddMethod,
1030 GetMembers, RemoveMember, GetEnumerator, add ChainHash's ext
1034 2004-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1036 * *Prototype.cs: return constructor.
1038 2004-11-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1040 * GlobalObject.cs: return the different kinds of object's
1042 * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
1043 NumberConstructor.cs, VBArrayConstructor.cs,
1044 FunctionConstructor.cs, EnumeratorConstructor.cs,
1045 BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs,
1046 ActiveXObjectConstructor.cs : added default constructor and static
1048 * ErrorConstructor.cs: added default and discriminatory ctrs. Let
1049 us know which type of error we are.
1050 * DateObject.cs: add field that hold the millisecond representation of date.
1051 * JSError.cs, JScriptException.cs: back to Microsoft.JScript namespace.
1052 * DatePrototype.cs: add default ctr.
1054 * MathObject.cs: implement its methods.
1056 2004-11-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1058 * DateConstructor.cs: runtime support, ported parse method from Rhino.
1060 2004-11-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1062 * CodeGenerator.cs: (ff_emit_relational) receive a full
1063 EmitContext as parameter. Added
1064 ff_emit_equality_cond. (fall_false) take where of the case where
1065 an expression is received.
1067 * Parser.cs: use ToJSToken for building the Relational
1068 object. Map relational Token's to JSToken's.
1069 * expression.cs: Added Size property to class
1070 Expression. (emit_create_instance): Added Number code generation.
1072 * Relational.cs (Emit): fix typo, emit boxing to boolean.
1074 2004-11-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1076 * NumericBinary.cs: implement EvaluateNumericBinary.
1078 2004-11-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1080 * CodeGenerator.cs: factor code for fall_true/fall_false (add
1081 emit_default_case, ft_binary_recursion, ft_emit_equality,
1082 ff_emit_relational, ff_binary_recursion). Fix
1083 trouble with logical ops code generation.
1085 2004-11-12 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1087 * TypeOf.cs, Plus.cs, Equality.cs: implementation of
1088 JScriptTypeOf, EvaluatePlus, EvaluateEquality.
1089 * Convert.cs (ToString): use the IConvertible/TypeCode approach
1090 for convertions. Add GetTypeCode.
1092 * Parser.cs, expression.cs: discriminate among =, +=, -=, etc. Add overload of
1095 2004-11-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1097 * expression.cs (emit_late_call): Pop after Call or CallValue when
1098 needed. (New.Emit) add emit_create_instance.
1101 2004-11-08 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1103 * expression.cs (class New): add new operator support. Add
1104 emit_args, implemented Emit.
1106 * expression.cs: emit unary operator code.
1107 * TypeOf.cs: back to Microsoft.JScript namespace. fix typo.
1108 * Literal.cs: constrain more the case of negative numeric literal.
1110 * expression.cs (emit_func_call): pop if function's return type is
1111 non-void and has no effect.
1113 2004-11-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1115 * BinaryOp.cs: added constructor for instantiating derived classes.
1116 * BitwiseBinary.cs, Equality.cs, In.cs, InstanceOf.cs,
1117 NumericBinary.cs, Plus.cs, Relational.cs, StrictEquality.cs,
1118 expression.cs (classes Binary, Assign): use inherited constructor.
1119 * BitwiseBinary.cs, Equality.cs: deleted public constructor which carried the context.
1121 2004-10-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1123 * StringObject.cs: add value field
1125 * expression.cs: implement LateBinding. Added methods:
1126 emit_late_binding, init_late_binding, emit_late_get_or_set,
1127 get_global_scope_or_this, setup_late_call_args, load_script_func, emit_late_call
1128 * Convert.cs: implement CheckIfDoubleIsInteger and CheckIfSingleIsInteger
1130 2004-10-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1132 * ast.cs (Function): added method emit_return_local_field, if
1133 there's a return stm inside a function we must allocate a
1134 JSLocalField indicating the return type of the function.
1135 * FunctionDeclaration.cs, FunctionExpression.cs: generate the
1136 extra JSLocalField if needed
1138 2004-10-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1140 * Parser.cs: set the operator properly.
1142 2004-10-11 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1144 * GlobalObject.cs: ported encodeURI, encodeURIComponent,
1145 decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode.
1147 * expression.cs (Call.Emit): implement IsConstructorProperty.
1149 2004-10-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1151 * expression.cs: added support for function calls. Handle case of
1152 print where no args are supplied.
1154 2004-10-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1156 * ast.cs: added GetContainerFunction property.
1157 * Statement.cs: added class NotVoidReturnEventArgs and delegate
1158 NotVoidReturnEventHandler, throw an event in case we find a
1159 return, the enclosing function object takes care of changing the
1160 return type of the function.
1161 * FunctionDeclaration.cs, FunctionExpression.cs: take care of
1162 return's inside functions.
1164 2004-09-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1166 * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField.
1168 * Parser.cs: use ToJSToken to set the operator properly.
1169 * FunctionDeclaration.cs: delete spaces.
1171 2004-09-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1173 * FunctionDeclaration.cs: check for parent being a ScriptBlock.
1175 2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1177 * expression.cs: added semantic analysis for accessing fields on
1178 class Binary. Semantic Analysis for Calls it takes care of
1179 constructors and methods, added invocation code for built in
1180 methods. Added interface IAccesible that let us resolve the '.'
1181 operator. Class Args handles missing or surplus arguments. Added
1182 class BuiltIn which will take care of all builtins of ECMAScript.
1183 * ast.cs: added check for parent equal to ScriptBlock.
1184 * SymbolTable.cs: added method Remove.
1185 * Statement.cs: Added abstract class Jump of which Continue and
1186 Break inherit, checks the label stuff. Added checks for Label
1187 stuff to Continue and Break classes. Added method Init for
1188 DoWhile. Fixes for loops statements in order to be able for have
1189 nested loops. Initial support for Label statements.
1190 * SemanticAnalizer.cs: added hash global_env and
1191 IdentificationTable label_set for keeping track of global methods and
1192 label sets. Added static constructor, method BuildGlobalEnv,
1193 ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel,
1194 GetLabel, RemoveLabel.
1195 * Relational.cs: added code generation for ops instanceof and
1196 in. Fixes for usual relational ops.
1197 * Parser.cs:fixes to keep track of the inheritance chain.
1198 * MathObject.cs: added internal constructor.
1199 * JSFunctionAttribute.cs: added fields value and built_in_function
1200 so we can decide when a method is really a built in.
1201 * IdentificationTable.cs: added method Remove.
1202 * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression.
1204 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1206 * expression.cs: made Binary is IAssignable, added fields assign
1207 and right_side, added method ResolveAssign (which now receives an
1208 extra parameter, being the right side of the assigment). Take care of being
1209 inside a function for array indexing. Take care of lvalue case
1210 too. Assign.Emit just calls left.Emit since left knows everything
1211 about the right side of the assigment after Resolve process.
1212 * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
1213 * BinaryOp.cs: renamed current_op to op as with the new
1214 parser we no longer need to keep track of the old_op.
1216 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1218 * expression.cs: do not pass the operand as a parameter to the
1219 constructor as it gets after the parent gets constructed, same
1220 with binary. Added code generation for array index access.
1221 * Parser.cs: added ToJStoken which converts Token to JSToken,
1222 factored the code for creation the Unary nodes. Take care of
1223 parent relationship.
1224 * LateBinding.cs: back to Microsoft.JScript namespace.
1227 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1229 * Parser.cs: pass the skip_count to ArrayLiteral constructor.
1230 * Missing.cs: back to Microsoft.JScript namespace.
1231 * ArrayLiteral.cs: added field skip_count, it tells us if this is
1232 a spaced-arrayliteral, in which case we add a null value in the
1233 list, added null check in the resolve and code generation process.
1235 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1237 * expression.cs: added interface ICallable and and function AddArg
1238 to class Call. Added class New.
1239 * driver.cs: made it use the new lexer and parser.
1240 * ast.cs: added field line_number, added property InFunction,
1241 added class Function that factores all the code shared between
1242 FunctionDeclaration and FunctionExpression.
1243 * With.cs: constructor receives line number.
1244 * VariableStatement.cs: constructor receives line number.
1245 * VariableDeclaration.cs: Added check for parent being
1246 FunctionDeclaration and FunctionExpression.
1247 * Try.cs: Moved the code that used to take care of the catch to
1248 Catch class. Constructor receives forming elements and line
1249 number. Removed mangle_id.
1250 * Throw.cs: constructor receives line number.
1251 * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed
1252 identifier to label in Continue and Break class, its constructor now
1253 receives the label and line number. For class, constructor
1254 receives its forming parts. Switch class, constructor receives
1255 line number, added function AddClause and AddStm. Added class
1256 Catch. Added class Labelled.
1257 * SemanticAnalyser.cs: Added field anon_method_counter, properties
1258 NextAnonymousMethod and CurrentAnonymousMethod.
1259 * Parser.cs: function ArgumentList receives a ICallable list
1260 instead of a AST. Now we add the arguments of a callable. Build
1262 * Literal.cs: added constructor for 'this' literal and
1263 ObjectLiteral constructor. Added RegExpLiteral class, will take
1264 care of regular expressions semantic analysis and code generation.
1265 * JSScanner.cs: use no more the antlr based lexer. Fix typo.
1266 * JSParser.cs: make it use the new port of Rhino's Parser.
1267 * FunctionObject.cs: Added constructor that receives the function name.
1268 * FunctionExpression.cs: made it inherit from Function class. Added
1269 constructor. Factored the code that used to set the prefix to
1270 Function.set_prefix (it's shared with FunctionDeclaration). Added
1271 fields local_script_func and field. Implemented Resolve and Emit
1272 (now we can do: var x = function (this, method, is, anonymous) {... };).
1273 * FunctionDeclaration.cs: made it inherit from Function class in
1274 order to share code with FunctionExpression. Added new
1275 constructor. Moved the code that used to built the prefix to
1276 Function inside function set_prefix. When building the closure
1277 added check for setting the type of a FunctionExpression. Moved
1278 set_function_type and set_custom_attr to class Function.
1279 * ForIn.cs: added constructor and fields lhs, obj and body.
1280 * Block.cs: added default constructor and line number based
1281 constructor. Check for elems not being null before adding.
1282 * ArrayLiteral.cs: set elements in constructor.
1284 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1286 * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
1287 building the other block was not needed. Build the ast's for the
1288 expressions and statements, keep track of the parent relationship.
1290 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1292 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
1293 Mozilla/Rhino's parser.
1295 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1297 * jscript-lexer-parser.g: added ast building for object_literal,
1298 it's disabled for now while I fix the "block Vs object_literal"
1299 non-determinism problem on the parser. Added rule for
1300 array_literal. Build PropertyName ast build.
1301 * Literal.cs: fixed the negative numbers code generation (we must
1302 optimize this). Added initial ObjectLiteral's class, code generation and
1303 Resolve process. Added class ObjectLiteralItem and PropertyName.
1304 * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
1305 elisions we keep track of the "real" size here. Added constructor. Added initial
1306 Resolve and Emit code.
1307 * ASTList.cs: added Size property.
1308 * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
1310 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1312 * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
1313 break and continue in order to jump to the desired place. Added
1314 check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
1315 * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
1316 need to jump if the expression evaluates to true. Continue class,
1317 replaced ParentIsItrStm with InLoop, emit jump to correct
1318 place. Break class, implemented Resolve; deleted
1319 ParentIsCorrect. DoWhile, While classes, set LoopBegin and
1320 LoopEnd. While class, set LoopBegin and LoopEnd.
1321 * ast.cs: Added InLoop and InSwitch.
1322 * jscript-lexer-parser.g: pass parent to break_stm. Added block as
1323 a statement. Temporarily disabled object_literal in order to test
1324 the block structure and continue and break statements.
1326 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1328 * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
1329 property. Added initial pieces for Break's Resolve. Fixed bug that
1330 did not let Emit the code for case clauses that came after the
1331 default clause (we match the jsc behavior).
1332 * jscript-lexer-parser.g: set parent of switch's clauses.
1334 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1336 * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
1337 * jscript-lexer-parser.g: set parent hierarchy for continue
1338 statement. Set to correct parent in iteration_stm.
1340 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1342 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
1344 * Statement.cs: Added code generation support for 'switch' statement.
1346 * jscript-lexer-parser.g: added 'using' for
1347 System.Collections. Allow 'switch' statement building of its
1348 ast. Added parent parameter to constructor of With. Build
1351 * With.cs: code generation support for 'with' stm.
1353 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1355 * Statement.cs: initial code generation of 'for'.
1356 * jscript-lexer-parser.g: let's build for's ast.
1358 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1360 * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
1361 * expression.cs: handle Try case for field or local vars allocation.
1362 * Try.cs: implemented Emit.
1363 * Throw.cs: implemented code generation.
1364 * FunctionDeclaration.cs: cache some values.
1366 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1368 * FunctionDeclaration.cs: let's make function name formation
1369 (get_name ()) a little bit less dumb. We cache the prefix now so
1370 we don't have to recalculate it everytime.
1372 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1374 * Literal.cs: emit the correct code for negative numbers.
1375 * jscript-lexer-parser.g: set parent unary_expr.
1377 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1379 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
1380 * Statement.cs: Added code generation for while and do-while.
1382 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1384 * Statement.cs (class if): reimplemented Emit based on fall_false.
1385 * Equality.cs: added code generation for != and emit jumping code
1386 only in the case we are at a global expression not statement.
1387 * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
1388 boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
1390 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1392 * expression.cs (Binary.Emit): treat boolean operator
1393 specially. Added emit_jumping_code.
1394 * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
1395 fall_false, which will express all boolean expressions and control
1398 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1400 * Equality.cs: Moved the Emit and Resolve code here.
1401 * jscript-lexer-parser.g: Build a Equality object instead of a
1402 Binary object for equality_expr.
1403 * expression.cs: moved equality oeprators (resolve and IL gen) to
1404 Equality.Emit and Equality.Resolve.
1406 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1408 * expression.cs: Added shift operators IL emit.
1409 * BitwiseBinary.cs: added constructor for building it according to
1410 JSToken enum. return a new object on EvaluateBitwiseBinary (this
1411 needs a real implementation).
1412 * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
1414 * Statement.cs: added stub for While and DoWhile ast
1415 representation (reworking my Emit code).
1416 * jscript-parser-lexer.g: allow iteration statement ast build.
1418 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
1420 * expression.cs: added Modulo operator case.
1422 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1424 * Convert.cs: added rule for string conversion.
1426 * Plus.cs: added rule for string addition.
1428 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
1429 Emit (cases where there's no real operator).
1431 * StringLiteral.cs: now implements Exp as can appear as a simple
1432 exp in global code. Added check for Pop generation.
1434 * expression.cs: added IL generation code for print func call.
1435 Args class added get_element, Size and made Resolve behave as the
1436 others (collect the differents Resolve's return values from each
1437 of the arguments). Expression class, added default Resolve call
1438 for non-Exp implementers.
1440 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
1441 AST, this handles the case where no postOrPrefixOp present; Unary
1444 * FormalParameterList.cs: added get_element, retrieves nth element.
1446 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1448 * ScriptStream.cs: let's print some messages.
1450 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
1452 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1454 * jscript-lexer-parser.g: keep track of return's parent.
1455 * Statement.cs: added parent parameter to constructor.
1457 * expression.cs: refactored Emit code from Identifier, now we take
1458 care of function's paramenter references. First attack to function
1459 calls, check if Resolve from Call succeed.
1461 * VariableDeclaration.cs: Deleted Decl class, field_info and
1462 local_builder fields were being used only by VariableDeclaration,
1463 I'll keep them there.
1465 * FormalParameterList.cs: added field pos to FormalParam, and set
1466 it at FormalParameterList's Resolve stage.
1468 * TODO: updated TODO.
1470 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1472 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
1474 * expression.cs: At class Conditional renamed fields. Class
1475 Expression inherits from Exp as we must keep track if we must pop
1476 the last value (this is for the comma operator), track the parent,
1477 at Resolve we take care of the last value of the expression,
1479 * VariableDeclaration.cs: updates needed because of EmitContext change.
1481 * Statement.cs: added parent param to If constructor. Implement
1482 Resolve and Emit for If statement.
1484 * Relational.cs: Set parent. The boxing happens in the containing statement.
1486 * FunctionDeclaration.cs: Added func_type field, will be used to determine the
1487 type of the function we are generating (global function, method
1488 from a class, etc) and attach to it the correct custom
1489 attribute. Simplified the code for nested functions:
1490 refactored the code so no code duplication is involved, now we
1491 have only one function that retrieves the name of the function,
1492 now create a new EmitContext for the body of the method.
1494 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
1495 current EmitContext's ILGenerator.
1497 * Convert.cs: Do not throw the NotImplementedException anymore for
1498 method ToBoolean, for now we always return false. This must get a
1499 real implementation.
1501 * CodeGenerator.cs: Deleted one of ILGenerator fields
1502 from EmitContext, suffices using only one (more notes about the
1503 change on the Functiondeclaration entry). Imitate jsc behavior for
1504 compiled files names, aggregate the exe or dll extension after last dot.
1506 * Block.cs: In order to implement the comma operator (i.e., expression,
1507 assign_exp), we must track if our expressions are at a global
1508 scope, in which case we must pop the last result too.
1510 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1512 * Relational.cs: Initial generation of CIL for relational operators.
1514 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1516 * jscript-lexer-parser.g: formal_param_list receives a parent too.
1518 * SymbolTable.cs: added size and current_symbols properties.
1520 * JSLocalField.cs: don't throw not ImplementedException from
1521 constructor (same reason, testing purposes, must get implemented
1524 * IdentificationTable.cs: added num_of_locals and current_locals properties.
1526 * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
1527 as fields. Not throw NotImplementedException for
1528 JScriptFunctionDeclaration (testing purposes, must get implemeted
1529 for real). Let's build our function closures! Added functions:
1530 build_closure and build_closure_nested, build_local_fields. Keep
1531 track of current parameters and locals defs.
1533 * FormalParameterList.cs: made FormalParam inherit from
1534 AST. Implement the Emit for parameters, yeah!
1536 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
1538 * Closure.cs: do not throw the exception (this allow me to run the
1539 tests at mcs/jtests and check that at least i'm not generating
1540 invalid CIL). Be aware that this must be really implemented.
1542 * Block.cs: renamed field, and implement the double pass for
1543 nested function declarations code emittion, yeah!.
1545 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1547 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
1548 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
1549 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
1550 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
1551 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
1553 * UnaryOp.cs: inherit from Exp now.
1554 * Plus.cs: Don't throw the exception when calling constructor, let
1555 it build the default handler. Return a new object when calling
1556 EvaluatePlus until properly implemented.
1558 * NumericUnary.cs: added new Resolve.
1559 * NumericBinary.cs: assign operator val at ctr. Return a new
1560 object when calling EvaluateNumericBinary until properly
1561 implemented. Added Resolve.
1562 * Equality.cs: added ctr and return false for EvaluateEquality
1563 until properly implemented. Added Resolve's functions.
1565 * Block.cs (Resolve): That check was not necessary.
1567 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
1568 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
1569 BinaryOp and UnaryOp, and this from Exp.
1570 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
1571 * jscript-lexer-parser.g: deleted debugging messages. Create a
1572 Assign object instance of a simple Binary obj. Same case for Equality.
1574 * expression.cs: added Exp abstract class. Classes that are ast of
1575 language constructions that can appear as global expressions that
1576 get evaluated and then the result is discarded inherit from this
1577 new class. This let meee keep track of things that must get Popped
1578 or can even avoid the evaluation of it. Wrote real Resolve method
1579 for classes: Unary, Binary.
1580 Implemted Emit method for some binary operations (+, -, / and *),
1581 for other operators some more code is still missing.
1582 Identifier: handle assignment cases and global exp cases.
1583 Added class Assign (compisite assignment still missing tough :-(
1585 * driver.cs: deleted debug messages, added "Compilation Succeeded"
1587 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
1588 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
1589 Exp and handle the case for global expressions that must be popped
1590 after evaluation. no more invalid IL being generated! yeah!
1591 * Block.cs: wrote real Resolve method, erased debug messages.
1592 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
1593 * BinaryOp.cs, Conditional: now inherits from Exp.
1595 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1597 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
1599 * CodeGenerator.cs: small fixes to generate same things that ms.
1601 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1603 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
1605 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
1607 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
1609 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1611 * jscript-lexer-parser.g: keep track of parent reference for
1612 IDENTIFIER, STRING_LITERAL.
1614 * expression.cs: Added 'binding' field. Added 'parent' parameter
1615 to constructor. Now we emit the proper code for the identifier.
1617 * VariableStatement.cs: updated to field names instead of the old
1620 * VariableDeclaration.cs: Added class Decl, it constains the
1621 references to the static field or LocalBuilder that are created
1622 when a declaration is emitted. Deleted unuseful properties (Id,
1625 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
1626 object instead of a boolean.
1628 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
1630 * IdentificationTable.cs: Deleted Retrieve method. Contains method
1631 now return an object instead of a boolean, that reference is the
1632 binding associated with the identifier being searched.
1634 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1636 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
1638 * VariableDeclaration.cs: now I handle initialization (ex. var x =
1639 2; or function f () { var x = 4; }) at global scope or at
1642 * Literal.cs: Added parent param to NumericLiteral constructor.
1644 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
1646 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1648 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
1650 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1652 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
1653 "instanceof"; }' in order to be able to parse both keywords. When
1654 generating the parser, one warning about nondeterminism
1655 (k==1:"in") is generated ignore it.
1657 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1659 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
1660 not parsable now they are. Mozilla's and Janet's test suites are
1661 being really helpful.
1663 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1665 * jscript-lexer-parser.g: added check for non-null reference at
1666 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
1667 and multiple lines comments rule.
1669 * jscript-lexer-parser.g: Now I keep track of the parent for most
1670 of the syntatic constructs. Fixed object_literal rule.
1672 * ast.cs: Added field parent. This will help me to track nested
1673 blocks for all of the syntatic constructs and will allow to Emit
1674 everything in one single pass.
1675 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
1677 * Block.cs, FunctionObject.cs: deleted parent field as AST will
1678 hold it. Delete parent parameter from constructor.
1679 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
1680 EmitContext class. The idea is Emitting everything in one pass (decls
1681 and 'Global Code' method, the parent reference let me know which IL
1682 generator use, gc_ig or ig).
1683 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
1684 constructor. Use new parent reference for choosing the IL
1685 generator. NumericLiteral a 'hard coded' int32 IL emittion added
1687 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
1688 the parent reference to infere which IL generator to use.
1689 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
1690 reference to infer which IL generator to use.
1691 * expression.cs: Added paramenter parent to constructor of: Unary,
1692 Binary, Conditional, Call.
1694 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1696 * expression.cs: Added new field to Call class, so it can handle more arguments.
1698 * StringLiteral.cs (Emit) : Load the string value.
1700 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
1702 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
1703 custom attribute. Build default 'JScript 0' constructor. Emit
1704 default initial/final code of 'Global Code'. Create default
1707 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1709 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
1710 repeating hand written rule all around. Change "." for DOT, dumb
1711 mistake by myself. Added rule new_expr. Now we handle properly the
1712 call_expr rule (as defined on the spec), and added a new
1713 argument. Added subrule new_expr to left_hand_side_expr rule.
1715 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1717 * expression.cs (Expression): implemented Emit.
1719 * expression.cs (Binary): Emit now creates a local for the
1720 different kinds of binary expressions (initial code for this).
1722 * ast.cs: Emit method now is abstract instead of virtual.
1724 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
1726 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
1727 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
1728 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
1729 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
1730 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
1731 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
1732 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
1733 Conditional, Call, Identifier, Args, Expression, :
1736 * FunctionDeclaration.cs: Check if values are not null first (at
1737 Resolve). Ignore code generation is at 'Global Code'.
1739 * VariableDeclaration.cs: Now I take care of IL generation when we
1740 are at statements and expressions at global code, 'Global Code'
1741 method is populated with that IL.
1743 * CodeGenerator.cs: Added flag for 'Global Code' method
1744 emittion. Now I call 'Emit' twice. The first for declarations the
1745 follower for statements and expressions at global scope.
1747 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
1749 * Visitor.cs: Deleted.
1751 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
1753 * FormalParameterList.cs: Now inherits from AST. Each of the
1754 formal parameters gets into the IdentificationTable at Resolve.
1756 * FunctionDeclaration.cs:Resolve (), We open a new block when
1757 encountering a FunctionDeclaration, resolve de parameters and the
1758 body, at the end we close the block.
1760 * IdentificationTable.cs: Now we keep track of parent of the
1761 current block. 'Enter (...)' now receives an object, not a
1762 VarDecl. 'Contains' now take care of searching through the binding
1765 * Literal.cs: Deleted 'Literal' class, was being used for
1766 nothing. All the classes the inherited from it, now do it from
1767 AST. A 'literal' does resolve to true by default.
1769 * Relational.cs: Resolve recursively left and right.
1771 * SemanticAnalyser.cs: added flag for 'print statement'.
1773 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
1776 * driver.cs: Init the semantic analysis phase.
1778 * expression.cs: 'Unary' class, resolves its operand
1779 first. 'Binary' class,resolves left and right first. 'Args' class
1780 resolve all the formal parameters first. 'Expression' resolve all
1781 the nested expressions first.
1783 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
1785 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
1787 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
1788 this is temporal in order to get Factorial compiled by mjs (must
1789 build the types according to Ecma-262 spec).
1791 * Literal.cs: Added NumericLiteral class.
1793 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
1795 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
1796 if inside a nested block.
1798 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
1800 * jscript-lexer-parser.g: Now we take care of parents. This allows
1801 to keep track if we are inside nested blocks. At
1802 'func_decl_or_expr', now I built the FunctionDeclaration or
1803 FunctionExpression first and then assign its body to it - this let
1804 me get a non-null value of the FunctionExpression or
1805 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
1807 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
1808 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
1809 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
1811 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
1813 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
1814 (gets the name of a function if it's nested). Emit code for
1815 function's body. At 'Emit ()' now we take care if it's a nested
1818 * FunctionObject.cs: default return type is 'void' not
1819 'Object'. Function declarations without parameters map to functions with
1820 'Object this' and 'VsaEngine engine' as parameters by
1821 default. Assign parent to nested block.
1823 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
1824 a global declaration or inside a function declaration.
1826 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
1828 * FunctionObject.cs: Handle no parameters on functions.
1830 * jscript-lexer-parser.g: Allow functions without parameters.
1832 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
1834 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
1835 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
1836 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
1837 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
1838 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
1839 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
1840 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
1841 With.cs, expression.cs : Added
1842 'Resolve' method stub.
1844 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
1846 * FormalParameterList.cs: Added FormalParam class. Change Add
1847 method to receive the id and the type annotation from function's parameters.
1849 * FunctionDeclaration.cs: Added code for initial function's
1850 definition code generation.
1852 * FunctionObject.cs: Added MethodAttributes and type_annot
1853 fields. Added params_types function, which returns an array of
1854 types from each of the function's parameters.
1856 * IdentificationTable.cs: Added ToString method.
1858 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
1859 and add it again with the correct name). Not based on the Visitor
1860 pattern anymore. Deleted all the VisitFOO methods. Added a
1861 IdentificationTable field. Added Run, Dump methods.
1863 * Statement.cs: Deleted Statement class (it was being used for
1864 nothing). All classes that were having Statement as parent,
1865 changed their parent to be AST.
1867 * SymbolTable.cs: Added Add method that receives the id and the
1868 declaration class. Retrieve changed to return an AST. Added
1869 ToString method. Added 'SymbolTable parent' field.
1871 * VariableDeclaration.cs: Added InitValue property.
1873 * ast.cs: Added some comments and abstract method 'Resolve'.
1875 * jscript-lexer-parser.g: Added parsing support for formal
1876 parameters type annotations.
1878 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
1880 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
1883 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
1885 * jscript-lexer-parser.g: allow empty program files. Added type
1886 annotations on var decl and function decl.
1887 * VariableDeclaration.cs: added return type annotation field.
1888 * FunctionExpression.cs: added return type parameter to constructor.
1889 * FunctionDeclaration.cs: added return type parameter to
1890 constructor. Added Emit method (just creates the static field at
1891 the global object, for now).
1892 * FunctionObject.cs: added return type to constructor. Changed
1893 names to readable ones ;-)
1895 * ScriptStream.cs: added WriteLine.
1897 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
1899 * ast.cs: Added 'virtual' Emit method (I might change it to be
1900 abstract, but I would have to added to all classes that derive
1901 from it. I'll do it later)
1902 * Block.cs: Added Emit method.
1903 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
1904 anymore) - still missing some methods, ut on the way. A nice
1905 hacking weekend coming. Added EmitContext class.
1906 * ScriptBlock.cs: Added Emit method.
1907 * VariableDeclaration.cs: Changed type field from string to
1908 Type. Added Emit method.
1909 * VariableStatement.cs: Added Emit method.
1910 * driver.cs: Added CodeGeneration phase (only simple var
1911 declarations support it. More coming soon).
1914 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
1916 * statement.cs: added Return class.
1918 * Throw.cs: Added expression field, constructor and ToString.
1920 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
1923 * With.cs: added constructor and ToString. Back to the non-tmp
1926 * jscript-parser-lexer.g: allow with_stm tree building.
1928 * jscript-lexer-parser.g: changed the return type from if_stm from
1929 'If' to AST. Added tree for continue_stm. Allowed building of
1932 * statement.cs: switched to internal 'If' class. Added Continue
1933 class. Added Break class.
1935 * jscript-lexer-parser.g: build tree for function decl or expr.
1937 * FunctionDeclaration.cs: added internal constructor.
1939 * FunctionExpression.cs: added internal constructor.
1941 * FunctionObject.cs: added internal constructor and ToString method.
1943 * jscript-lexer-parser.g: added building tree for if_stm.
1944 * Statement.cs: Added if class for 'if' statement.
1947 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
1949 * VariableDeclaration.cs: added the initializer to ToString.
1951 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
1954 * Block.cs, Equality.cs, Relational.cs: modified ToString
1956 * Equality.cs, Relational.cs, StringLiteral.cs,
1957 VariableDeclaration.cs: Added constructor
1959 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
1960 name convetion style to mono style.
1962 * UnaryOp.cs: added operator and operand fields.
1964 * VariableDeclaration.cs: chenged field name from assignExp to val.
1966 * BinaryOp.cs: Made "internal" the attributes, added the two
1969 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
1971 * driver.cs: Dump the string representation of the parsed exps.
1973 * Literal.cs: added BooleanLiteral
1975 * Relational.cs: added constructor, ToString,
1977 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
1979 * README: added some info about hacking the grammar
1981 * JSparser.cs: Updated the constructor to not receiving params.
1983 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
1984 JScriptParserTokenTypes.txt: update of antlr generated files from
1987 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
1988 can parse a little bit more useful programs like:
1990 function factorial (i)
1997 k = factorial (i - 1);
2006 As you can see, it's not the classic factorial function
2007 definition, I still have to make some tricks like storing the
2008 result from the recursive call and then multiply. But this new
2009 grammar it's easier to alter than the old one. Also we got support
2010 for for-in statements, for statements, global expressions, support
2011 for object accesors or better known as the "dot" operator. Two
2012 rules are on the eye: left_hand_size_expr and call_expr, in order
2013 to finish the parsing grammar and fix the bugs.
2016 2003-09-29 <cesar@ciencias.unam.mx>
2018 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
2020 * Added VsaItem.cs, implements IVsaItem.
2022 2003-09-28 <cesar@ciencias.unam.mx>
2024 * VsaItems.cs: Check that no name is repeated (this was docs fault
2025 :-)). This is the beauty of testing.
2027 * Add VsaItems.cs, implements IVsaItems.
2029 2003-09-22 <cesar@ciencias.unam.mx>
2031 * DocumentContext.cs: changed constructor from internal to public,
2032 this a kind of hack ;), but we can build mjs.exe with that change.
2034 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
2035 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
2036 StringLiteral.cs, StringConstructor.cs, Statement.cs,
2037 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
2038 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
2039 Package.cs, ObjectConstructor.cs, NumberObject.cs,
2040 NumberConstructor.cs, MathObject.cs, Literal.cs,
2041 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
2042 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
2043 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
2044 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
2045 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
2046 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
2047 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
2048 ErrorConstructor.cs, EnumeratorObject.cs,
2049 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
2050 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
2051 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
2052 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
2053 ActiveXObjectConstructor.cs, ActivationObject.cs:
2055 indentation comformance to mono style. Returned to
2056 Microsoft.JScript namespace name. Now we can build
2057 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
2058 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
2059 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
2060 about the namespace stuff, because I want people
2061 to contribute NUnit tests for Microsoft.JScript public API.
2063 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
2065 2003-09-21 <cesar@ciencias.unam.mx>
2067 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
2069 2003-09-20 <cesar@ciencias.unam.mx>
2071 * jscript-lexer-parser.g: We are little bit closer to the spec on
2072 StringLiteral definition.
2074 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
2076 * jscript-lexer-parser.g: Build ast for FunctionExpression.
2078 * JSObject.cs: we don't throw NotImplementedException anymore,
2079 this let us use FunctionExpression to build the ast.
2081 * FunctionExpression.cs: Added a FunctionObject as field, a
2082 default constructor.
2084 * FunctionObject.cs: Added default constructor.
2086 * driver.cs: Deleted the Jsc class. We are not generating code
2087 now. I'm moving to provide something like mcs's EmitContext
2088 instead of the CodeGenerator class having the Reflection.Emit
2089 builders and ILGenerator. This driver is just for Lexical and
2090 Parsing phases testing.
2092 * driver.cs: Now we are using the Microsoft.JScript public API
2093 functions to load the lexer and parser.
2095 * ScriptBlock.cs,Block.cs: Added ToString function.
2097 2003-09-20 <cesar@ciencias.unam.mx>
2099 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
2100 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
2101 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
2102 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
2103 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
2104 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
2105 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
2106 : erased Visit method and made some mono indentation style changes.
2108 * CodeGenerator.cs: commented some function calls.
2109 * FunctionDeclaration.cs: moved function attributes to
2110 FunctionObject class, erased Visit method.
2111 * FunctionObject.cs: Here is where we store a function
2112 expression/declaration info, erased Visit method.
2113 * ScriptBlock.cs: Added a Block field, Block will contain the
2115 * jscript-lexer-parser.g: updated the grammar to build the program
2116 representation based on ScriptBlock.
2118 2003-09-19 <cesar@ciencias.unam.mx>
2120 * JSToken.cs: public API compliance.
2122 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2124 * Context.cs: Added constructor and Document field.
2125 * DocumentContext.cs: Added Name field.
2126 * JSParser.cs: Integration of antlr's generated parser with
2127 JSParser public API. ScriptBlock is now the principal data structure that
2128 represents a Jscript .Net program.
2129 * JSScanner.cs: Integration of antlr's generated lexer with
2130 JSScanner public API.
2132 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2133 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
2135 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2137 * jscript-lexer-parser.g: Changed the namespace to
2138 Microsoft.JScript.Tmp.
2140 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
2142 * jscript-lexer-parser.g: Got the name of a
2143 global_function_declaration and also its return type if
2146 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
2147 * jscript-lexer-parser.g: Initial construction of AST for
2148 enum_statement and package_statement.
2150 * jscript-lexer-parser.g: Fixed the enum_statement to accept
2151 empty enum declarations.
2153 * jscript-lexer-parser.g: Got the type of a
2154 veriable_declaration.
2156 * jscript-lexer-parser.g: Initial construction of AST for
2157 primary_expression (in particular literal).
2160 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2162 * driver.cs: Modified the driver structure to be compatible
2163 with our new CodeGenrator and SemanticAnalizer. I
2164 removed the builders from Reflection.Emit to the
2165 CodeGenerator. Added an ASTList, SemanticAnalizer and
2166 CodeGenerator here. Adde methods Run, GenerateCode
2169 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2170 * Statement.cs: Forgot to include it on last commit.
2172 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2174 * Decided to change temporarly namespace name
2175 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
2176 to run the code generated by our CIL code generator (on next
2177 commit will come). The problem is that we don't have the
2178 runtime support for our compiler, this involve VsaEngine class
2179 and its "friends", which I have not found a lot of
2180 doumentation for. If someone knows a docs place for them,
2181 don't hesitate to send me a email pointing to them.
2183 * Changed from public to internal Visit function at some
2186 * Package.cs: Added Name and Members fields.
2188 * SemanticAnalizer.cs: Added methods VisitPrint and
2191 * VariableDeclaration.cs: Added Type field.
2193 * Visitor.cs: Changed from public to internal. Added
2194 VisitPrint and VisitStringLiteral methods.
2196 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
2197 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
2202 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2204 * Added CmdLineError.cs and JSError.cs, last night I forgot to
2207 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2209 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
2210 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
2211 CmdLineException.cs, CmdLineOptionParser.cs,
2212 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
2213 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
2214 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
2215 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
2216 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
2217 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
2218 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
2219 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
2220 LenientDateConstructor.cs, LenientDatePrototype.cs,
2221 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
2222 LenientFunctionPrototype.cs, LenientMathObject.cs,
2223 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
2224 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
2225 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
2226 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
2227 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
2228 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
2229 PostOrPrefixOperator.cs, RangeErrorObject.cs,
2230 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
2231 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
2232 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
2233 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
2234 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
2235 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
2236 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
2237 VersionableAttribute.cs
2239 Now, I must fill in the blanks :-)
2242 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2243 * jscript-lexer-parser.g: Added conditional_compilation_directive,
2244 which is the beginning of our support for conditional compilation
2245 statements and directives in our parser. Added
2246 cc_on_statement, and some lexer rules for getting the needed
2247 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
2248 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
2251 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2253 * jscript-lexer-parser.g: Changed the format of copyright notice.
2255 This changes will allow the support
2256 for the grammar added by MS to EcmaScript (aka its JScript .Net),
2257 I'm still missing some, but they are on the way.
2259 * jscript-lexer-parser.g: Deleted function_declaration, and
2260 added global_function_declaration and type_function_declaration.
2261 I decided to make the grammar as strict as the MS docs mark,
2262 but there's a difference between what their docs says and what
2263 their compiler does. For this case I decided to follow the
2264 docs. A program like:
2265 private function F ()
2267 according to the docs, would not be syntaticly correct. But the MS
2268 compiler, accepts the grammar construct and mark the error at
2269 semantic analysis phase. I followed the docs this time.
2271 * jscript-lexer-parser.g: Added debbuger_statement.
2272 * jscript-lexer-parser.g: Added import_statement.
2273 * jscript-lexer-parser.g: Added package_statement and package_member(s).
2274 * jscript-lexer-parser.g: Added super_statement.
2275 * jscript-lexer-parser.g: Added const_statement.
2276 * jscript-lexer-parser.g: Added class_statement,
2277 interfaces_list and class_members.
2279 * jscript-lexer-parser.g: Added interface_statement and
2282 * jscript-lexer-parser.g: Added enum_statement.
2283 * jscript-lexer-parser.g: Added static_statement. The rule for
2284 this syntatic construc is: static identifier { [body] }
2285 body does not get well specified in the docs. Must search wich
2286 are the possible values of it.
2288 * jscript-lexer-parser.g: At variable_declaration, added
2289 support for explicit type declaration.
2291 * jscript-lexer-parser.g: Added numeric_literal,
2292 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
2294 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
2297 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2300 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
2301 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
2302 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
2305 That method will be the driver that will allow classes
2306 that implement the Visitor interface do a walk through the AST's
2307 elements, in particular the Semantic Analizer and the Code
2308 Generator. Every class that inherits from AST will have a Visit
2309 method, that method will receive a Visitor and a object as
2310 parameters, the only thing that it'll do is letting the Visitor
2311 call the respective method VisitX, where X is the name of the
2312 currently visited class.
2314 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
2316 * FunctionDeclaration.cs: Added constructor, Visit and ToString
2319 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
2320 program (the main entry of the parser). Also added as parameters:
2321 - An AST to source_element.
2322 - A Statement to statement.
2323 - A VariableStatement to variable_statement.
2324 - A VariableStatement to variable_declaration_list.
2325 - A FormalParamerList by formal_parameter_list.
2326 - A ASTList by function_body.
2328 And now some rules return objects:
2329 - A VariableDeclaration by variable_declaration.
2330 - A Functiondeclaration by function_declaration.
2332 * driver.cs: Added the construction of the AST of the EcmaScript
2335 * Visitor.cs: Added this file. It's the visitor interface.
2337 * VariableDeclaration.cs: Added this class, it's the AST
2338 representation of a variable declaration.
2340 * Statement.cs: Added this file. It's the logical representation
2343 * VariableStatement.cs: Added this class. It's the AST
2344 representation of a chain of variable declarations.
2346 * FormalParameterList.cs: The function declaration needs to store
2347 its parameter, we will put them on this class.
2349 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
2350 implement the semantic analysis and code generation
2351 phases. SemanticAnalizer and CodeGenerator will implement the
2352 Visitor interface, they will walk a program's
2353 AST tree and do their respective work.
2355 * IdentificationTable.cs: Added this class. The SymbolTable will be used
2356 by the SemanticAnalyzer in order to keep track of the variable
2357 declaration encountered, etc..
2359 * SymbolTable.cs: A simple hashtable but for commodity i'll call
2363 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2365 * jscript-lexer-parser.g:
2366 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
2367 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
2368 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
2369 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
2370 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
2371 - Changed INTERROGATION to CONDITIONAL.
2372 - Changed TRIANGLE to BITWISE_XOR.
2373 - Changed SLASH to DIVISION.
2374 - Changed PERCENT to REMAINDER.
2375 - Changed ADMIRATION to LOGICAL_NOT
2376 - Added BITWISE_NOT (~).
2377 - Added the INCREMENT and DECREMENT rules for
2378 left_hand_side_expression.
2379 - Increased lexer lookup from 2 to 4.
2380 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
2381 BITWISE_AND, BITWISE_OR,
2382 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
2383 REMAINDER, UNSIGNED_RIGHT_SHIFT.
2384 - Added the recursion rules for equality_expression.
2385 - Added the recursion rules for shift_expression.
2387 - The most important thing, added support for expressions like:
2390 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2393 - Erased the Context class, it was used for the first
2394 test of the print_statement and Reflection.Emit. As I erased the
2395 Program, SourceElements, SourceElement from the ANTLR grammar (for
2396 the rework of the AST tied to the MS JScript public API), I erased
2398 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
2399 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
2400 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
2403 * jscript-lexer-parser.g:
2404 - Erased the references to the classes Program, SourceElements,
2405 SourceElement, Statement, FunctionDeclaration and erased
2406 print_statement rule.
2408 * JSCriptLexer.cs JScriptParser.cs and the other files generated
2409 by antlr, reflect changes from the grammar changes.
2411 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2412 * Added stubs for the classes:
2415 ActiveXObjectConstructor.cs
2419 AssemblyCustomAttributeList.cs
2424 BooleanConstructor.cs
2432 EnumeratorConstructor.cs
2438 FunctionConstructor.cs
2439 FunctionDeclaration.cs
2440 FunctionExpression.cs
2444 IActivationObject.cs
2450 JSFunctionAttribute.cs
2451 JSFunctionAttributeEnum.cs
2456 LenientGlobalObject.cs
2458 NumberConstructor.cs
2460 ObjectConstructor.cs
2462 RegExpConstructor.cs
2467 StringConstructor.cs
2472 VBArrayConstructor.cs
2477 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2479 * jscript-lexer-parser.g:
2480 - Added rules for: continue_statement, break_statement,
2481 return_statement, throw statement (all of them do not ensure that
2482 no LineSeparator appears between the keyword on the left and the
2483 identifier, expression or semicolon on the right, that must be fixed).
2484 - Added single line comments rule.
2486 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2488 * jscript-lexer-parser.g: Added syntatic rule for:
2490 - while and for-in subrules of iteration_statement.
2491 - Added array_literal - got tricky - I just could get the simplest rule going :)
2495 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2497 * jscript-lexer-parser.g:
2498 - Syntatic rule for iteration_statement.
2499 - "do" subrule for it.
2500 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
2501 "in") relational_expression | ) rule to relational_expression.
2502 -Added function_expression syntatic rule.
2503 - Added STRING_LITERAL to literal rules.
2504 - "Less/Greater or equal than" lexer rule.
2506 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2508 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
2510 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2512 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
2515 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2517 * Added a README file. Explains the dependencies and build process.
2519 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2521 * Added this ChangeLog file.
2523 * ast.cs: Added this file. Contains the classes used for building
2524 the EcmaScript 's AST.
2526 * JScript*: These are the files generated by antlr (the parser generator).
2528 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
2530 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
2531 that will be moved to other file in the future.
2533 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.