2006-07-26 César Octavio López Natarén * JScriptCodeGenerator.cs, JScriptCodeProvider.cs: Use implementation from Akiramei (mei@work.email.ne.jp). 2006-06-08 Cesar Lopez Nataren * Added the NPL license (as that's the header the original java files have) header to Token.cs, TokenStream.cs, Parser.cs and Decompiler.cs to avoid confusion. Also, the notice has always been stated in mcs/LICENSE that: "The Microsoft.JScript assembly is covered by the MIT X11 and the Mozilla MPL license as it contains ported pieces of code from Rhino, the Mozilla JavaScript implementations" And we include mcs/LICENSE.MPL 2006-04-18 Cesar Lopez Nataren * TokenStream.cs: Ciao to_string. 2006-04-18 Miguel de Icaza * TokenStream.cs: kill to_string method, it was one inneficient way of turning char [] into strings. Use the proper String constructor for that. 2006-01-25 Cesar Lopez Nataren * FunctionExpression.cs: Set the prefix at resolve time not at constructor time. Solves a bug related to the use of nested FunctionExpression's. 2006-01-24 Cesar Lopez Nataren * ast.cs (Function.set_prefix): use InFunction and GetContainerFunction for retrieving the container function. * Statement.cs (Return): Implement ICanModifyContext as can return a FunctionExpression. * FunctionDeclaration.cs: Erase unused method Init. 2006-01-18 Evan Briones * GlobalObject.cs: parsefloat in ms.net version returns NaN for text strings. If a match is found the regular expression returns its value. Otherwise the value of the object is retained. Previously it would return an empty string if nothing matched making. Double.TryParse would then return 0. Example of this returning NaN : var isnan = 'hello'; print (parseFloat(e)); Example of it returning 0 : var iszero = 'string'; print (parseFloat (iszero)); We behave like Rhino. 2006-01-17 Cesar Lopez Nataren * Parser.cs: Propagate the proper parent. Fixes #75166. * ast.cs: Added virtual method PropagateParent for recovering a lost parent or set it up properly if previously set to null. * Statement.cs (If,Jump,Break.PropagateParent): recover the proper parent. * expression.cs (Binary.emit_access): Emit late binding code for member's access that maps to MemberTypes (like Math.pow). Fixes #72440. 2006-01-13 Cesar Lopez Nataren * ForIn.cs: implement for (x in obj) logic. 2006-01-11 Cesar Lopez Nataren * Parser.cs (StatementHelper): Avoid null reference exception using the new EmptyAST node in case we have an empty stm (Token.SEMI). 2006-01-10 Cesar Lopez Nataren * Empty.cs: Add internal type EmptyAST. * Parser.cs: Avoid creating a ForIn object when we only have empty condition, test or increment expressions in the loop. 2006-01-08 Cesar Lopez Nataren * SemanticAnalizer.cs, Import.cs: No longer use the Mono.CSharp stuff; we lookup for the namespaces in our code (stolen from mcs source code though :) * Namespace.cs: Handle the namespace lookup here. 2005-12-15 Cesar Lopez Nataren * Parser.cs: Use the new assign ctr and Init method. * expression.cs (Assign): Modify the number of ctr and added the Init method. * BinaryOp.cs: Add setter for left. * Statement.cs (For.Emit): Take into account what relational operator is in place. * expression.cs (Assign.Emit): Emit box in the op= cases. 2005-12-10 Florian Gross and Evan Briones * ForIn.cs (JScriptGetEnumerator) : Returns a new IEnumerable GetEnumerator. * JSObject.cs (JSObjectEnumerator) : Enumerates the property names. * JScriptException.cs : Added NotCollection exception. * Convert.cs (ToForInObject): If value isn't null returns GlobalObject.Object.CreateInstance(value) * LateBinding.cs : Added StringObject for getting and setting object property 2005-12-10 Cesar Lopez Nataren * CodeGenerator.cs: Add EmitAssignAsExp. * expression.cs: Take care of uses of assigment in a expression context; we must save the right-side value in a local and then load the local. Added Assign.EmitAndReturnBuilder. 2005-11-25 Cesar Lopez Nataren * With.cs (JScriptWith): Use Convert.Object before we cast to ScriptObject as literals fail to be put in the scope chain's front. * expression.cs (Call.Emit): implement the case when the invoked method at call is a property. * Latebinding.cs: return null in case we don't mach anything. 2005-11-22 Cesar Lopez Nataren * Statement.cs (Return.Resolve): Added field exp_returns_void which allow us to return a method call as the return expression value even when the method call returns void; we emit null in such a case. * ast.cs (Function): switch from 'protected' to 'internal' property HandleReturnType. 2005-11-21 Cesar Lopez Nataren * Statement.cs (class Switch): Preserve the value of EmitContext.LoopEnd as can be overriden in nested blocks, for example in a switch statement inside a for-loop. 2005-10-28 Raja R Harinath * Import.cs (Resolve): Update to changes in GMCS. * SemanticAnalizer.cs (ComputeNamespace): Likewise. 2005-10-23 Florian Gross * LateBinding.cs: Changed to accept object instead of ScriptObject in a lot of places 2005-10-23 Raja R Harinath * Import.cs (Resolve): Update to changes in MCS code. 2005-10-11 Cesar Lopez Nataren * CodeGenerator.cs (CodeGenerator): EmitRelationalComp handle 'in' operator case. * Add support for multiple files compilation. This involved addig an extra pass into the AST for ensuring the resolve process, this pass is named PopulateContext. The AST nodes that implement ICanModifyContext call PopulateContext. * IdentificationTable.cs: Added class Environment, which is a symbol table which takes into account namespace info, this is for package statement future implementation. 2005-09-30 Cesar Lopez Nataren * expression.cs (Expression::Resolve): check if we have an assigment in a chain of expressions and stms, it fixes #75801, and give us 660 more successful tests. 2005-09-13 Cesar Lopez Nataren * SemanticAnalyser.cs: Add field assemblies. Run now receives the assembly's array, add method ComputeNamespaces, * Parser.cs: Add support for the 'import' statement. Add field code_items, new constructor, methods ParseAll and Import. * Import.cs: Implement Resolve and Emit methods. * ScriptBlock.cs: Add default ctr. 2005-09-11 Cesar Lopez Nataren * expression.cs (Identifier::emit_undeclared_assignment): Fix small regression related to the value/refs patch. All works again for undeclared variables. 2005-09-09 Cesar Lopez Nataren * SemanticAnalyser.cs, expression.cs (Unary): Fixes for delete operator. 2005-09-08 Cesar Lopez Nataren * Relational.cs: The loading of true or false it's generated by EmitRelationalComp not in Relational.Emit as is not always needed. * CodeGenerator.cs: Add EmitRelationalComp. * expression.cs (Args.Emit, emit_default_args_case): take care of Relational operator case. 2005-09-06 Florian Gross * ObjectPrototype.cs: Implemented better working hasOwnProperty * In.cs: Implemented JScriptIn * LateBinding.cs: Added LateBinding.Delete, HasObjectProperty, DirectHasObjectProperty 2005-09-06 Cesar Lopez Nataren * CodeGenerator.cs (GetBoxType): Take into account the case where the type is relational whose operator is In. 2005-09-02 Cesar Lopez Nataren * SemanticAnalyser.cs: Added IsDeletable, check if a property is in an object's constructor. * CodeGenerator.cs: Added JSToken.Delete to GetBoxType. * expression.cs: (Unary) Added field deletable. Take care of the case when the property that we are trying to delete is not deletable, we use late binding's method Delete for that. (Binary) Added property IsDeletable. (Args) Do not pop the values of arguments which implement Exp. 2005-08-28 Florian Gross * Try.cs: Implemented JScriptExceptionValue * DateConstructor.cs: Adjusted rounding of date values * RegExpPrototype.cs: Truncates lastIndex before using it * With.cs: Implemented JScriptWith -- can't test this yet because of compiler bugs * ErrorPrototype.cs: Adjusted toString (no ClassName) * JScriptCodeGenerator.cs: Implemented CreateEscapedIdentifier, CreateValidIdentifier, GenerateAssignStatement, GenerateComment, GenerateConditionStatement, GenerateMethodReturnStatement, GenerateThisReferenceExpression, GenerateThrowExceptionStatement, GenerateVariableDeclarationStatement, IsValidIdentifier, QuoteSnippetString. Added dont_write_semicolon, GetSafeName, FillKeywordTable, keywords. Most of this is very similar to the implementation of the C# CodeGenerator * DatePrototype.cs: prototype's time value is NaN, not 0 * Closure.cs: Sets _prototype from func * FunctionObject.cs: Changed prototype of user functions * ErrorObject.cs: Added GetDefaultValue * GlobalObject.cs: parseFloat handles whitespace correctly. Various bug fixes for parseInt * RegExpObject.cs: lastindex changed to double (was int) 2005-08-19 Cesar Lopez Nataren * SemanticAnalyser.cs: Added ArrayLiteral, StringLiteral, BooleanConstant, ByteConstant, ShortConstant, IntConstant, LongConstant, FloatConstant, DoubleConstant to the prototypes. Added methods IsNumericConstant, NeedsToBoolean. * Parser.cs: Added methods InRangeOf, HasNoDecimals which help on building the property AST node depending on how big and precise the number is. * CodeGenerator.cs: (emit_get_default_this) Receives an extra argument which indicates if we are inside a method, use load_engine. Added method EmitBox, EmitConv, GetBoxType * Literal.cs: Add abstract class Constant. Renamed BooleanLiteral to BooleanConstant. Delete NumericLiteral, handle the number code generation properly categorizing in ByteConstant, ShortConstant, IntConstant, LongConstant, FloatConstant and DoubleConstant which inherit from NumericConstant. (ObjectLiteral) Handle boxing issue. * Statement.cs, Relational.cs: (If) Handle boxing issue. * VariableDeclaration.cs: Handle the boxing issue when we have initializers. * Equality.cs, StrictEquality.cs: Handle the boxing issue before invoking EvaluateEquality, JScriptStrictEquals. * ArrayLiteral.cs: Implement ICanLookupPrototype so we can optimize access to methods through the prototype and not generating IL code that uses late binding. Handle the boxing issue. * expression.cs: (Unary.Emit) Nuke emit_unary_op. Take care of properly boxing the operands of methods that evaluate the unary operators at runtime. Fix the minus logic for IL generation, add method emit_non_numeric_unary. Optimize the numeric cases. (Binary) Add LateBinding internal property. (Binary.emit_late_get_or_set, emit_array_access, Conditional.Emit, Call.Emit, emit_print_stm, emit_late_call, setup_late_call_args, EmitBuiltInArgs, Identifier.Emit, Args.Emit, Expression.Emit, Assign.Emit, New.Emit) Take care of properly boxing the built in .NET values. (force_strong_type) Change the type from ParameterInfo to object, take care specifically. (Expression) Add Last internal property. In general, the point is that value types like integers, booleans, etc... do not have to generate a box operation, the user of the arg must handle that. 2005-08-17 Florian Gross * ScriptObject.cs: Added settable _proto for __proto__. This isn't currently exposed to JScript, but set by FunctionConstructor.CreateInstance. Moved AddField, ClassName, proper_array_index up from JSObject * Constructors: Added _length * JSObject.cs: Moved AddField, ClassName, proper_array_index up to ScriptObject. Added precaching of prototype fields * PostOrPrefixOperator.cs: EvaluatePostOrPrefix correctly promotoes old value to number. Implemented ++obj.a and obj["a"]-- * ActivationObject.cs: Added GetMemberValue * expression.cs: Added logic for undeclared variables from cesar and got it to work * ObjectPrototype.cs: toString works on ScriptObjects now * JScriptException.cs: Added extra_data for adding details to the built-in messages * IdentificationTable.cs: Adjusted internal name mapping logic * Bindings.cs: Added stubbed IsMissing * JSFieldInfo.cs: Added SetValue with Binder and CultureInfo stub * Convert.cs: Added IsBoolean, implemented ToString for GlobalScope * LateBindings.cs: Added name, obj constructor. Heavily refactored by adding GetObjectProperty, TryDirectGetObjectProperty, TryGetNativeProperty, DirectSetObjectProperty, TrySetNativeProperty and changed methods to use them. We now do prototypes correctly in general which also slows us down. MapToInternalName does substituation of $ to dollar_. Implemented a simple property cache * BooleanPrototype.cs: Better implementations of toString, valueOf * Parser.cs: Fixed parsing of "in" keyword in argument lists * FunctionPrototype.cs: Works with all ScriptFunctions * RegExpObject.cs: Added extra data to RegExpSyntax exception * GlobalScope.cs: Initializes elems, removed redundant AddField override and implemented stub GetField with lex level * ScriptFunctions.cs: Correctly sets __proto__ on result 2005-08-13 Florian Gross * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs, NumberConstructor.cs, FunctionConstructor.cs, BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs, ErrorConstructor.cs: Added name * ScriptObject.cs: Added HasMethod, CallMethod uses SemanticAnalyser.map_to_prototype and forwards engine * ArrayPrototype.cs: Implemented sort, added SortHelper * expression.cs: Implemented delete operator code generation * NumericUnary.cs: Implemented EvaluateUnary (currently unused) * ObjectPrototype.cs: smartToString falls back to toString instead of duplicated code * StringPrototype.cs: Fixed replace logic for replacement functions * FunctionDeclaration.cs: More user function infrastructure * FunctionObject.cs: Implemented ToString for user functions. Moved name, return_type, parameters, ToString up to ScriptFunction. Constructors set _prototype * Closure.cs: More user function infrastructure * Convert.cs: ToString Uses smartToString if no custom toString exists * BooleanObject.cs: Constructor now uses Convert.ToBoolean * LateBindings.cs: GetMethodFlags logic for anonymous functions. Initial implementation of DeleteMember. Implemented constructor cases in Call and CallValue * Relational.cs: Implemented EvaluateRelational, JScriptCompare * Parser.cs: Fixed bugs in decompiler calls so that the decompiled source code matches the original one * FunctionPrototype.cs: Fixed toString function check * Decompiler.cs: Adjusted indent properties. Made AddEOL not add semicolons to lines which already end with one. Implemented double literal logic * SemanticAnalyser.cs: Added more prototype mappings * ErrorConstructor.cs: Added ErrorTypeToName * FunctionExpression.cs: More user function infrastructure * ScriptFunction.cs: Added vsa_engine. Moved name, return_type, parameters, encodedSource, ToString up from FunctionObject. Implemented CreateInstance. Added initial setter for prototype. Added GetDefaultValue 2005-08-09 Florian Gross * BitwiseBinary.cs: Implement LeftShift, RightShift and UnsignedRightShift evaluation. Add method UnsignedRightShift. * Token.cs: Added field PrintNames, Add flag ignore_error to method Name. * Decompiler.cs: Fixes for >>> implementation. Clean up the port. 2005-08-09 Cesar Lopez Nataren * Parser.cs: Added infrastructure for closure construction support per Florian Gross and Miguel request ;-) * Decompiler.cs: Added to the repository. 2005-08-04 Jb Evain * CodeGenerator.cs: write a valid RequestAttribute on the assembly 2005-08-03 Florian Gross * ScriptObject.cs: Renamed __proto__ to proto for 1.1 compatibility * expression.cs: Uses LateBinding.MapToInternalName to map __proto__ to proto * StringPrototype.cs: replace doesn't use anonymous delegate anymore for 1.1 compatibility * JScriptException.cs: Added another case to ErrorMessage. * IdentificationTable.cs: Uses LateBinding.MapToInternalName to map __proto__ to proto * LateBinding.cs: Added MapToInternalName and changed code to use it. Fixed type mapping with varargs. Unwraps Closure objects to FunctionObjects. Fixed bug in SetField logic * JSObject.cs: Added ClassName for RegExpObject * ArrayPrototype.cs: More uint / int fixes for concat, splice, unshift * StringConstructor.cs: String() ought to be "undefined" * JScriptException.cs: Added code for user exceptions (eg. throw "x") * FunctionObject.cs: Implemented length for user functions * Convert.cs: uint / uint fix for Convert.ToNativeArray * Throw.cs: Implemented JScriptThrow * FunctionPrototype.cs: Correctly throws JSError.FunctionExpected instead of NotImplementedException * ScriptFunction.cs: Added arity as an alias for length (Mozilla) 2005-08-02 Cesar Lopez Nataren * TokenStream.cs: Display source name and line number. * SemanticAnalizer.cs: Added StringLiteral to prototypes. * Parser.cs: Added Location class, which tracks the SourceName and line number. Build every node from the AST tree with location info. * CodeGenerator.cs: Add emit_default_value. * expression.cs: (Binary.Resolve) Fix for calling directly the method from the prototype if the lhs binary expression is a literal, added ICanLookupPrototype interface. Display the source file name and line number in the errors. (Call) Added field need_this, simplify the logic infering the exact number of parameters from the called method. Added NeedThis. Re-implement Resolve and Emit from Args, delete DesiredNumOfArgs, IsPrint, has_var_args. Added Size, emit_default_args_case. Added location field to FunctionObject. StringLiteral implements ICanLookupPrototype. Fix typo from IAccessible :). * All classes that inherit from abstract class AST: Use constructor from AST that stores the parent and the new info from Location. 2005-08-01 Cesar Lopez Nataren * Statement.cs (Catch.Emit): Fix for properly emit code for loading the script engine. 2005-07-29 Cesar Lopez Nataren * All files at current dir: set svn:eol-style to native. 2005-07-28 Florian Gross * DateConstructor.cs: Sets _prototype. Added DateMod. MakeDay, IsLeapYear, DaysInYear, WeekDay, HourFromTime, MinFromTime, SecFromTime, msFromTime use DateMod (important for negative date values!) * ScriptObject.cs: Added implementation of proprietary __proto__ * JSObject.cs: Added more ClassName cases and fixed old ones. GetDefaultValue uses smartToString instead of toString * ArrayPrototype.cs: Added Proto. Switched indices and length values to use uint instead of int so we can represent the full Array size range from ECMA-262 * StringConstructor.cs: Sets _prototype * ObjectConstructor.cs: Sets _prototype * RegExpPrototype.cs: Added Proto. Uses uint instead of int for RegExpMatch length and indices * NumberConstructor.cs: Sets _prototype * expression.cs: force_strong_type always uses ToNumber (fixes broken arguments for Math.pow and so on) * ObjectPrototype.cs: Added Proto. toString is dumb and will output [object Array] when called on an Array instead of using ArrayPrototype.toString. Added smartToString which does the old behavior * StringPrototype.cs: Added Proto. Uses uint instead of int for arrays * JScriptException.cs: Added more cases to Message * ArrayObject.cs: Switched to uint for indices and length * FunctionConstructor.cs: Sets _prototype * Equality.cs: Rewrote equality logic. More cases covered, less code * DatePrototype.cs: Added Proto * Convert.cs: Added ToUint32. ToNumber with Arrays switched to uint * StrictEquality.cs: Added logic for function equality * StringObject.cs: Initializes value to "". Implemented Equals * LateBinding.cs: More cases covered. Added logic for converting arguments to match the signature. Added SetArrayLength. Refactored to use SetArrayLength * BooleanPrototype.cs: Added Proto and empty implementation of constructor * BooleanConstructor.cs: Sets _prototype * FunctionPrototype.cs: Added Proto * NumberPrototype.cs: Added Proto * ArrayConstructor.cs: Sets _prototype * SemanticAnalizer.cs: Added constructor and prototype information to prototypes lookup table * RegExpConstructor.cs: Sets _prototype * ScriptFunction.cs: Added _prototype and implemented prototype using it. Implemented Equals for built-in functions 2005-07-28 Cesar Lopez Nataren * expression.cs (emit_access): Take into account that __proto__ property (Mozilla extension) is contained in ScriptObject. 2005-07-27 Cesar Lopez Nataren * SemanticAnalizer.cs: Added Boolean/BooleanConstructor and Function/FunctionConstructor. Delete method Dump. 2005-07-25 Cesar Lopez Nataren * SemanticAnalizer.cs: Added Object/ObjectConstructor to the obj_ctrs. * expression.cs: Fixes error for cases like Constructor.Property. * SemanticAnalizer.cs: Added Array/ArrayConstructor to the ctrs. 2005-07-25 Marek Safar * IdentificationTable.cs: Fixed build. 2005-07-24 Florian Gross * DateConstructor.cs: CreateInstance handles Infinity, NaN and double with decimal places correctly and won't fail when trying to get the timezone offset for invalid values anymore. LocalTime keeps the date in the correct timezone * ScriptObject.cs: Moved GetField from JSObject.cs. CallMethod can be used to call ObjectPrototype methods on objects of derived prototypes. * JSObject.cs: Implemented SetMemberValue2, more cases for ClassName, added avoid_toString argument to GetDefaultValue to avoid infinite recursion from ObjectPrototype:toString * ArrayPrototype.cs: Fixed pop, shift to work with the auto-popping ArrayObject:length setter. Implemented toLocaleString * ObjectConstructor.cs: Refactored to use Convert.ToObject. Invoke works with null / undefined argument * StringConstructor.cs: Handles Object [] * RegexpPrototype.cs: exec made aware of $_ and UpdateLastMatch * JScriptInstanceOf.cs: Implemented JScriptInstanceof * NumberConstructor.cs: Handles Object [] * ObjectPrototype.cs: toString uses GetDefaultValue if available * StringPrototype.cs: match uses UpdateLastMatch, replace works with replacement function, split handles max_count correctly in all cases and calls UpdateLastMatch and handles no match case correctly * IdentificationTable.cs: CreateSymbol mangles "$" to "dollar_" so we can support RegExp.$1, Enter handles case where symbol exists already so that function foo (a, b, a) { } works * ArrayObject.cs: length setter pops elements if new size < old size * ErrorPrototype.cs: Implemented constructor, toString * JSFieldInfo.cs: Implemented Name * DatePrototype.cs: Made toDateString, toLocaleDateString, toLocaleString, toLocaleTimeString, toString, toUTCString handle invalid date value cases * NumericBinary.cs: Refactored to use Convert.ToNumber * Convert.cs: Refactored ToBoolean, ToInt32, ToNumber, ToObject to use IsNumberTypeCode. Added more object cases to ToNumber. ToNumber with string correctly choses parseInt or parseFloat instead of always using parseFloat. Implemented ToNativeArray. Added more cases to ToObject. Fixed ToString with double to be more standards conform * StringObject.cs: Implemented length getter * LateBinding.cs: Added GetMethodFlags, GetRequiredArgumentCount. Made assemble_args ignore trailing unneeded arguments and handle methods that don't have a thisObj argument. Added Invoke logic for Closure, FunctionObject and RegExpObject. Made GetNonMissingValue work correctly for GlobalScope. Correctly sets length when adding index properties to ArrayObjects. Implemented SetValue * GlobalObject.cs: Implemented escape, Function, unescape. Made parseFloat ignore some leading / trailing garbage * FunctionPrototype.cs: Implemented apply, call * RegExpObject.cs: ToString handles empty RegExp case correctly. Initialize made aware of $*. Implemented GetDefaultValue * TokenStream.cs: Handle overflows from float literals * ErrorConstructor.cs: Added ErrorTypeToClass, implemented CreateInstance * RegExpConstructor.cs: RegExpConstructor adds fields for $_, $&, $+, $`, $', $*. Added UpdateLastMatch. Invoke handles zero argument case. Added getters for $1 to $9. Implemented input, lastMatch, lastParen, leftContext, rightContext, multiline * ScriptFunction.cs: Implemented length getter and setter * SyntaxErrorObject.cs, ReferenceErrorObject.cs, TypeErrorObject.cs, ErrorObject.cs, EvalErrorObject.cs, RangeErrorObject.cs, URIErrorObject.cs: Added new ctr, which is used at ErrorConstructor::CreateInstance. * expression.cs: Use Missing.Value for missed parameters in method invocations. 2005-07-17 Florian Gross * DateConstructor.cs: Implemented UTC * ScriptObject.cs: Implemented GetMethod, CallMethod * JSObject.cs: Implemented fallback ToString, more ClassName cases and fallback GetDefaultValue * ArrayPrototype.cs: Fixed concat, join and added splice * RegExpPrototype.cs: Implemented compile, exec, test * expression.cs: Emit JS undef instead of JS null for missing args. * StringPrototype.cs: changed lastIndexOf to be compatible with JSC. Implemented match, replace (no replacement closure), search, split. No longer uses assert_type for ensuring right type of thisObj * ArrayObject.cs: Better length argument handling in constructor. Added SpliceSlowly * DatePrototype.cs: Added setDate, setFullYear, setHours, setMinutes, setMilliseconds, setMonth, setSeconds, setTime, setUTCDate, setUTCFullYear, setUTCHours, setUTCMinutes, setUTCMilliseconds, setUTCMonth, setUTCSeconds, setYear * FunctionObject.cs: Moved MethodAttributes to ScriptFunction. Added MethodInfo-taking constructor * Convert.cs: Added IsNumber, IsString, ToRegExp. More cases in ToNumber. Refactored ToString * ScriptEquality.cs: More cases * LateBindings.cs: Big refactoring. Introduced assemble_args. Handles missing arguments. build_args can pass null as engine. More CallValue, GetNonMissingValue cases * Plus.cs: Heavily refactored EvaluatePlus from 90 to 12 lines * GlobalObject.cs: Added CollectGarbage * NumberPrototype.cs: No longer uses assert_type for unsuring right type of thisObj * RegExpObject: Added lastIndex, Initialize, stores compiled Regex * SemanticAnalizer: Added missing prototypes. Made assert_type work with derived types * ScriptFunction.cs: Moved MethodAttributes from FunctionObject. Added MethodInfo. Implemented Invoke for built-in functions. 2005-07-07 Florian Gross * MathObject.cs: Implemented max and min (untested) * ObjectConstructor.cs: Implemented Invoke * StringConstructor.cs: Implemented Invoke and fromCharCode * PostOrPrefixOperator.cs: Implemented EvaluatePostOrPrefix * NumberConstructor: Implemented CreateInstance and Invoke * expression.cs: Implemented unary operators void, +, -, !, ~ and ! * ArrayPrototype.cs: Implemented concat, push and unshift * DatePrototype.cs: Implemented getDate, getDay, getFullYear, getHours, getMilliseconds, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getUTCDate, getUTCDay, getUTCFullYear, getUTCHours, getUTCMilliseconds, getUTCMinutes, getUTCMonth, getUTCSeconds, getVarDate, getYear, toDateString, toGMTString, toLocaleDateString, toLocaleString, toLocaleTimeString, toString, toTimeString, toUTCString and valueOf * ObjectPrototype.cs: Implemented toLocaleString and valueOf * StringPrototype.cs: Implemented substr and concat * Convert.cs: Implemented ToPrimitive, ToBoolean and ToUint16. Added more cases to IsNumberTypeCode, IsFloatTypeCode and ToInt32. Fixed ToString with doubles * Plus.cs: Added more cases. Fixed endless loop for unknown types via ugly goto * ArrayObject.cs: Added GetDefaultValue * NumberObject.cs: Added GetDefaultValue * StringObject.cs: Added GetDefaultValue * BooleanObject.cs: Added GetDefaultValue * GlobalObject.cs: Fixed parseFloat. Added parseInt and ScriptEngine* functions * JSObject.cs: Implemented abstract GetDefaultValue * BitwiseBinary.cs: Implemented &, ^ and | operators * BooleanConstructor.cs: Implemented Invoke * DateConstructor.cs: Implemented infrastructure for DatePrototype. Note: YearFromTime is ported from Rhino. Also implemented Invoke and CreateInstance. * NumberPrototype.cs: Implemented toFixed, toLocaleString and toString * TokenStream.cs: Fixed locale dependant float parsing * LateBinding.cs: Added proper support for varargs passing 2005-07-06 Cesar Lopez Nataren * FunctionExpression.cs (build_closure): Use CodeGenerator.load_engine. * Parser.cs: Restore pn as the parent. * expression.cs: Added is_dynamic_function field to class Call. It's not enough knowing if the parent is a FunctionExpression/FunctionDeclaration, we must assure that we are really inside a FunctionExpression/FunctionDeclaration in order to know in which place is the engine. setup_late_call_args and get_global_scope_or_this used the new field for loading the engine. 2005-07-05 Cesar Lopez Nataren * LateBinding.cs (CallValue): throw a NotImplementedException instead of a returning null. Fixes bug #75442 * FunctionExpression.cs (Emit): use InFunction instead of testing by hand. * Parser.cs (MemberExpr): pass parent as the parameter not pn. * expression.cs (get_global_scope_or_this): use CodeGenerator.load_engine for loading the engine, and invoke GetGlobalScope when the member_exp is a function expression. 2005-07-04 Cesar Lopez Nataren Fixes bug #75440 * expression.cs (emit_late_get_or_set, emit_late_call): Take care the case where the left hand side of a late bound expression is a literal. * SemanticAnalizer.cs: Added IsLiteral method. 2005-07-02 Florian Gross * ArrayPrototype.cs: Implemented pop, reverse, shift and slice * StringPrototype.cs: Implemented anchor, big, blink, bold, charAt, charCodeAt, fixed, fontcolor, fontsize, indexOf, italics, lastIndexOf, link, localeCompare, slice, small, strike, substring, sup, toLocaleLowerCase, toLocaleUpperCase, toLowerCase, toString, toUpperCase and valueOf * ArrayObject.cs: ArrayObject-ctor works correctly when first argument isn't length and first element gets assigned to 0 slot correctly * NumberObject.cs: Basic constructor / double value made internal * Equality.cs: Added basic logic for TypeCode.Empty, DBNull, Boolean and Char * FunctionObject.cs: ToString matches that of MS JS.NET for internal functions * Convert.cs: IsNumberTypeCode and IsFloatTypeCode utility methods, basic implementation of ToInt32 and ToNumber, more cases for ToString * StrictEquality.cs: Initial working implementation * LateBindings.cs: Call works for Methods that don't have HasEngine and support for getting methods (as in "foo".link) in GetNonMissingValue * Plus.cs: Added support for more types * GlobalObject.cs: Implemented isNaN, isFinite and parseFloat * FunctionPrototype.cs: Implemented toString * NumberPrototype.cs: Implemented valueOf * Globals.cs: Implemented ConstructArrayLiteral * TypeOf.cs: Added more cases 2005-06-10 Cesar Lopez Nataren * LateBinding.cs: Added field right_hand_side. Initial implementation of Call. Added build_args method. Initial implementation of GetNonMissingValue. * Convert.cs (ToObject): Add return values for TypeCode.String, TypeCode.Boolean, and TypeCode.Object. * RegExpPrototype.cs (toString): Implemented. * RegExpObject.cs: Implemented. * RegExpConstructor.cs: Implement Construct, CreateInstance, and Invoke. 2005-06-06 Cesar Lopez Nataren * expression.cs (emit_access): We can now access the properties from the Global RegExp object, they were not being accesible because they are properties not fields. 2005-05-31 Cesar Lopez Nataren * SemanticAnalizer.cs: Add the global, non-constructable RegExp constructor object to obj_ctrs so we can type-check its property access as well as fixing the break showed at #74681 now the raise the proper error code. Renamed method object_contains_method to object_contains, and now we filter on instance members too. * expression.cs: use new API from SemanticAnalizer. 2005-05-30 Cesar Lopez Nataren * Literal.cs: (RegExpLiteral.Emit): Take care of attributes. "g" is global, "i" is case-insensitive and "m" is multi-line. 2005-05-19 Cesar Lopez Nataren * Parser.cs: Throw NotImplementedException for function declarations that appear inside other statements (FunctionType.ExpressionStatement declarations). Fix the NullReferenceException from #74970. But now exposes #75002. 2005-05-18 Marek Safar * JScriptCodeGenerator.cs: Stubbed. * JScriptCodeProvider.cs: Implemented. 2005-05-17 Cesar Lopez Nataren * SemanticAnalizer.cs: Add methods_with_outter_scope_refs and methods_with_vars_used_nested hashtables. AddMethodReferenceOutterScopeVar, AddMethodVarsUsedNested, MethodReferenceOutterScopeVar. OutterScopeVar, MethodVarsUsedNested and VarUsedNested. * CodeGenerator.cs: Add locals_to_stack_frame method and emit_parents. * TypeManager.cs: Add LocalsAtDepth. * VariableDeclaration.cs: keep track of the lexical depth of current declaration. * FunctionDeclaration.cs: take care of outter scope variables uses. * IdentificationTable.cs: keep track of Catch statement opened blocks. * expression.cs: take care of eval's Net_1_0 and greater versions. Implement the use of variables in nested scopes. For it, we track the variable's scope level and we compare it with the level in which appears if there's a difference supperior to one and the variables wasn't not declared in the global scope we proceed to generate the code that keep tracks of the state of the variables through a StackFrame, in which we copy the local vars prior to the invocation to the nested method which uses a outter scope variable, then we copy back the variables in the StackFrame into de local vars when the invocation finishes. * Try.cs: open a scope indicating that's for a catch block. 2005-05-07 Cesar Lopez Nataren * MethodInvoker.cs, ScriptObject.cs, BitwiseBinary.cs, ActivationObject.cs, PostOrPrefixOperator, StackFrame.cs, NumericUnary.cs, JSConstructor.cs, Equality.cs, NumericBinary.cs, Convert.cs, LateBinding.cs, Plus.cs, BitwiseBinary.cs, JSMethodInfo.cs, Relational.cs, ScriptFunction.cs : Add missing debugger attributes. 2005-05-06 Cesar Lopez Nataren * Binding.cs: add missing methods and fields. 2005-05-03 Cesar Lopez Nataren * ReturnOutOfFinally.cs, SyntaxErrorObject.cs, TypeReflector.cs, JSPrototypeObject.cs, ReferenceErrorObject.cs, Namespace.cs, expression.cs (Unary class), Binding.cs, ArrayWrapper.cs, CmdLineOptionParser.cs, TypeErrorObject.cs, JSConstructor.cs, TypedArray.cs, FunctionWrapper.cs, SuperTypeMembersSorter.cs, ContinueOutOfFinally.cs, BlockScope.cs, AssemblyCustomAttributeList.cs, VersionableAttribute.cs, SimpleHashtable.cs, ResInfo.cs, Import.cs, NotRecommendedAttribute.cs, CmdLineException.cs, DebugBreak.cs, VBArrayObject.cs, CmdLineError.cs, TODOAttribute.cs, RegExpMatch.cs, JScriptCodeProvider.cs, RangeErrorObject.cs,: Fixes for API compliance. 2005-04-28 Cesar Lopez Nataren * BinaryOp.cs, ActivationObject.cs, expression.cs (Args), ArrayLiteral.cs, ArrayObject.cs, IRedirectOutput.cs, ASTList.cs, IVsaScriptScope.cs, ast.cs (AST), BinaryOp.cs, EnumeratorObject.cs, BreakOutOfFinally.cs, Enum.cs, FormalParameterList.cs, FunctionDeclaration.cs, Equality.cs, Closure.cs, Block.cs, Statement.cs, BooleanObject.cs, LenientBooleanPrototype.cs, GlobalObject.cs, BooleanPrototype.cs, CodeGenerator.cs, LenientDateConstructor.cs, LenientGlobalObject.cs, JSToken.cs, MethodInvoker.cs, LenientRegExpPrototype.cs, NumericUnary.cs, LenientArrayPrototype.cs, JSParser.cs, JSPropertyInfo.cs, LenientVBArrayPrototype.cs, LenientStringPrototype.cs, LenientObjectPrototype.cs, With.cs, ScriptBlock.cs, Expando.cs, JSScanner.cs, LenientEnumeratorPrototype.cs, EvalErrorObject.cs, VariableDeclaration.cs, Print.cs, LenientErrorPrototype.cs, LenientBooleanPrototype.cs, LenientFunctionPrototype.cs, Literal.cs, LenientMathObject.cs, LenientDatePrototype.cs, Relational.cs, Parser.cs, Throw.cs, VariableStatement.cs, RegExpObject.cs, Eval.cs, SemanticAnalizer.cs, LenientStringConstructor.cs, LenientNumberPrototype.cs, FieldAccessor.cs : Changes for MS API compliance. 2005-04-18 Cesar Lopez Nataren * Parser.cs: Build a StrictEquality object instead of a Equality object, when we have === and !=== as operator. * CodeGenerator.cs: (ft_emit_equality, fall_true) Take into account the strict cases of equality. * StrictEquality.cs: Add parent, left and right params to default ctr. Implement Resolve and Emit. 2005-04-15 Cesar Lopez Nataren * Statement.cs: make internal the builders. * expression.cs: (Identifier.Emit) Take into account if its binding is of type Catch. 2005-04-14 Cesar Lopez Nataren * SemanticAnalizer.cs: Added a Hashtable that indicates which methods need to generate proper code for handling the local vars in the StackFrame. Added method AddMethodWithEval, MethodContainsEval. * Eval.cs: Back to M.J. * ast.cs: locals from abstract class Function is now an array of objects not just AST's. * CodeGenerator.cs: Clean up fall_true, better using recursion :) Added static method load_local_vars. At method ft_emit_equality do Emit the code of the ast. Added method load_local_vars. * FunctionDeclaration.cs: Update call to TypeManager methods to new API. Added a check for invocations to 'eval' inside functions so StackFrame IL code gets generated. Build the function's closure take the need for the StackFrame into account. * TypeManager.cs: renamed IdentificationTable locals to local_script_functions, AddLocal to AddLocalScriptFunction, GetLocal to GetLocalScriptFunction. Added method CurrentLocals. * IdentificationTable.cs: Method CurrentLocals now returns an array of object's not AST's. * expression.cs: (class Call) Check if we have a call to 'eval', if so we must keep up the StackFrame which contains the local vars. We generate special code that handles the StackFrame with the local vars in order to keep them in sync. When a function contains an invocation to 'eval' even when such function is a function declared in the code we do not perform a direct method call to it when invoked instead a call through late binding gets performed. Added methods IsEval, set_local_vars. Implement 'eval' from JScript! 2005-04-10 Cesar Lopez Nataren * StackTrace.cs: Back to M.J namespace. 2005-04-08 Gonzalo Paniagua Javier * Literal.cs: fix the build and broke something else ;-). 2005-04-08 Cesar Lopez Nataren * Literal.cs: Implement the construction of regular expression literal. * Parser.cs: Pass the proper parent to RegExpLiteral. 2005-03-30 Cesar Lopez Nataren * TypeOf.cs: take into account Objects. * ArrayConstructor.cs: Implement CreateInstance. * LateBinding.cs: Initial implementatio of CallValue and SetIndexedPropertyValueStatic. * JSFieldInfo.cs: Implement GetValue and SetValue. * ArrayObject.cs: Implement length, add three ctrs. * JScriptException.cs: Add error_number field. Implement ctr. ErrorNumber, Message and StackTrace. * ArrayPrototype.cs: Implement join and toString. * JSObject.cs: Remove the ChainHash, we use a simple hashtable now, the one inherited from ScriptObject. * ScriptObject.cs: Add a Hashtable here. 2005-03-29 Cesar Lopez Nataren * GlobalScope.cs: Set parent and engine in ctr. Return 'this' for GetDefaultThisObject. * ScriptObject.cs: Added protected 'parent' field of type GlobalScope. 2005-03-16 Cesar Lopez Nataren * FunctionExpression.cs: Update to TypeManager new API. * TypeManager.cs: Keep both MethodBuilder and LocalBuilder around. * FunctionDeclaration.cs: In some contexts we need the MethodBuilder and LocalBuilder, so we must keep both around. * expression.cs: (load_script_func) Take care if bounded variable was declared in a nested context. (emit_create_instance) Handle the FunctionConstructor case. 2005-02-28 Cesar Lopez Nataren * ForIn.cs: Initial implementation of ForIn stm. 2005-02-27 Cesar Lopez Nataren * VariableStatement.cs (PopulateContext): Do not add the symbol to the context if already defined in current context. * CodeGenerator.cs: Renamed VariableDefined to variable_defined_in_current_scope. * TypeManager.cs: Reimplemented it, We use an IdentificationTable instead of a simple Hashtable so we can handle scopes properly. Cleaner api. * VariableDeclaration.cs: Use new CodeGenerator api. (EmitDecl) Add the builders to the TypeManager. * Block.cs: Use new TypeManager api. * FunctionDeclaration.cs: Use new TypeManager api. Take care of scopes in the TypeManger on Emit. * IdentificationTable.cs: (Binder) Changed the type of value from AST to object so I can use this symbol table anywhere. (IdentificationTable) Add current_locals stack and added method InCurrentScope. * expression.cs: Use new api from TypeManager, Add casts where neeeded. This solves an infinite loop we were falling into when calling IdentificationTable.CurrentLocals when repeated declarations where inside function declarations. * ast.cs: Added protected field ig to class Function. * Block.cs: Emit function's body in a later phase since free ocurrences of functions - at the same level of it - can be handled properly, since they must be defined and inited to the correct values. * FunctionDeclaration.cs: Renamed Emit to create_closure. And make Emit only generate the code of the body. Fixes #73078. 2005-02-22 Cesar Lopez Nataren * Block.cs: Report error JS5040. Reopened #72674, see last comment of it. * CodeGenerator.cs: Added method VariableDefined. * TypeManager.cs: Added method SetMethod. * VariableDeclaration.cs (EmitDecl): Added logic to allow multiple declarations of the same var. Fixes #72674. * Block.cs: Added hashtable ocurrences. It holds the index of the previous declaration which after encountering another one with the same name gets nuked. * FunctionDeclaration.cs: Added logic for allowing multiple declaration of methods with the same name. Fixes #72674. * expression.cs (Args): Added field func. Holds a reference to the Function which to the args are being passed. Use it to track the proper number of arguments for the call. 2005-02-20 Cesar Lopez Nataren * expression.cs (Args.Emit): check if num_of_args is -1. * ast.cs (Function.NumOfArgs): avoid using a null pointer. In the code generation phase if num_of_args is -1 means the actual arguments are the desired number of args. Fixes #72697. * Parser.cs: Pass proper parent. * CodeGenerator.cs: added emit_get_default_this. * Literal.cs (This) : Resolve and Emit implemented. Fixes #72477 * expression.cs: (emit_late_get_or_set) use load_engine. (load_script_func) Ensure that TypeManager has a ref to the local otherwise it's a field. (New.Resolve) Check if late binding is needed. (New.Emit) Generate proper IL that make use of late binding when the id of the constructor it's not part of the build in objects. 2005-02-14 Cesar Lopez Nataren * Token.cs, TokenStream.cs, Parser.cs: make this classes internal. * Context.cs: delete wrongly exposed ctr. 2005-02-10 Cesar Lopez Nataren * expression.cs: use InFuntion in proper places. * Parser.cs: Add parameter that indicates if it's a prefix operator. When building the MemberExprTail set to proper parent. * PostOrPrefixOperator.cs: Partial implementation of ++ and --, prefix and suffix, we assume that the operand is a variable. 2005-02-09 Cesar Lopez Nataren * expression.cs: Added method EmitStore and EmitLoad to Identifier class. Implemented op= operators. Fixes 72393. 2005-02-08 Cesar Lopez Nataren * expression.cs (Identifier.Emit): Handle case where we are assigning to a formal parameter. Fixes #72333. 2005-02-06 Cesar Lopez Nataren * expression.cs: (load_script_func) Load localbuilder in an invocation when needed, this let us have higher order functions, which is lovely (Fixes #71129). Update calls to load_engine to new signature. * FunctionDeclaration.cs: Add LocalBuilder to TypeManager.locals * Statement.cs: Changed ctr to Init, so we can track correctly the parent hierarchy when building the ast of the program. * TypeManager.cs: Added field locals. Factored code for handling the tables. Added enums ManagedType and Operation. * Parser.cs: Track correctly the parent of return. * ast.cs (class Function): add ScriptBlock as possible parent of a global expression. * CodeGenerator.cs: change signature of load_engine. Instead of a AST a boolean. So we can call it with InFunction as parameter. 2005-02-05 Cesar Lopez Nataren * expression.cs: rework the late binding algorithm, we directly call an object's method if it's a static method of it. Added field late_bind, properties AccessField and Binding, renamed emit_access to emit_array_access to class Binary. Added fields params_info, late_bind and var_args to Class Args; also methods has_var_args, force_strong_type, reworked its Emit code, we take care of methods which have variable number of arguments, take care of needed conversions and boxing when the call has specific strong types as formal parameters. Added method IsPrint and property Parameters to class BuiltIn. * IdentificationTable.cs: Better implementation of jscript's environments semantics. Added classes Symbol and Binder. * SymbolTable.cs: Nuked. * Block.cs: Fix the semantic of semantic analysis and code generatipo process, we now allow forward declarations of variables and functions. * FunctionDeclaration.cs: Added default ctr and Init method. Fix the semantics of the Resolve and Emit process, we can have forward declaration of variables and functions. Fix order in which JSLocalField's get build. * FunctionExpression.cs: Fix order in which JSLocalField's get build. * VariableStatement.cs: Added methods EmitVariableDecls and PopulateContext. * VariableDeclaration.cs: Added method EmitDecl. Delay the Resolve and Emit process until the second phase. * Statement.cs: Resolve process of For class take care of VariableStatements for populating the environment in advance. * TypeManager.cs: Make GetMethod return a MethodBuilder. * ast.cs: Added field locals, property NumOfArgs, method GetName to abstract class Function. * SemanticAnalyser.cs: unified global environment and the stack of contexts. Added field global_obj, adapt methods to new IdentificationTable api. Delete method ObjectSystemContains. Added method contains, is_js_object, object_contains_method, map_to_ctr, get_member. * Try.cs: Update to new IdentificationTable api. * ScriptObject.cs, JSPropertyInfo.cs, FormalParameterList.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSLocalField.cs, ScriptFunction.cs: use full namespace name for Binder. 2005-01-17 Cesar Lopez Nataren * CodeGenerator.cs: Added load_engine. * expression.cs (emit_func_call), FunctionDeclaration.cs: Fix computation of VsaEngine. 2005-01-11 Cesar Lopez Nataren * StringConstructor.cs: implement CreateInstance. 2005-01-10 Cesar Lopez Nataren * BooleanPrototype.cs: update to assert_type. * SemanticAnalizer.cs: move BooleanPrototype.AssertType here, rename it to assert_type. 2005-01-06 Cesar Lopez Nataren * BooleanObject.cs: implement ctr's. * BooleanPrototype.cs: back to M.J namespace. Implement contructor property, toString and valueOf, add AssertType. * Convert.cs: add ToString overload and implement. * JSFieldInfo.cs, JSLocalField.cs: Add conditional NET_2_0 or BOOTSTRAP_NET_2_0 's Mono_GetGenericFieldDefinition. * StringObject.cs: add ctrs. 2005-01-05 Cesar Lopez Nataren * ObjectPrototype.cs: Add internal ctr. Implement hasOwnProperty. * ObjectConstructor.cs: implemented CreateInstance. * expression.cs (emit_create_instance): add Boolean case. * Try.cs, Statement.cs (EmitStms), Literal.cs (ObjectLiteralItem.Emit), CodeGenerator.cs (fall_false): delete unused variables. 2004-12-15 Cesar Lopez Nataren * CodeGenerator.cs: add support for compiling not only from cwd. 2004-12-13 Cesar Lopez Nataren * expression.cs: emit code for null literal. 2004-12-06 Cesar Lopez Nataren * expression.cs: added StringConstructor case. * MemberInfoList.cs: added internal classes Node, ListIter, ChainHash and implement MemberInfoList. * JSObject.cs: implement AddField, AddProperty, AddMethod, GetMembers, RemoveMember, GetEnumerator, add ChainHash's ext field. 2004-11-30 Cesar Lopez Nataren * *Prototype.cs: return constructor. 2004-11-25 Cesar Lopez Nataren * GlobalObject.cs: return the different kinds of object's constructors. * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs, NumberConstructor.cs, VBArrayConstructor.cs, FunctionConstructor.cs, EnumeratorConstructor.cs, BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs, ActiveXObjectConstructor.cs : added default constructor and static contructor field. * ErrorConstructor.cs: added default and discriminatory ctrs. Let us know which type of error we are. * DateObject.cs: add field that hold the millisecond representation of date. * JSError.cs, JScriptException.cs: back to Microsoft.JScript namespace. * DatePrototype.cs: add default ctr. * MathObject.cs: implement its methods. 2004-11-24 Cesar Lopez Nataren * DateConstructor.cs: runtime support, ported parse method from Rhino. 2004-11-22 Cesar Lopez Nataren * CodeGenerator.cs: (ff_emit_relational) receive a full EmitContext as parameter. Added ff_emit_equality_cond. (fall_false) take where of the case where an expression is received. * Parser.cs: use ToJSToken for building the Relational object. Map relational Token's to JSToken's. * expression.cs: Added Size property to class Expression. (emit_create_instance): Added Number code generation. * Relational.cs (Emit): fix typo, emit boxing to boolean. 2004-11-19 Cesar Lopez Nataren * NumericBinary.cs: implement EvaluateNumericBinary. 2004-11-15 Cesar Lopez Nataren * CodeGenerator.cs: factor code for fall_true/fall_false (add emit_default_case, ft_binary_recursion, ft_emit_equality, ff_emit_relational, ff_binary_recursion). Fix trouble with logical ops code generation. 2004-11-12 Cesar Lopez Nataren * TypeOf.cs, Plus.cs, Equality.cs: implementation of JScriptTypeOf, EvaluatePlus, EvaluateEquality. * Convert.cs (ToString): use the IConvertible/TypeCode approach for convertions. Add GetTypeCode. * Parser.cs, expression.cs: discriminate among =, +=, -=, etc. Add overload of ToJSToken. 2004-11-10 Cesar Lopez Nataren * expression.cs (emit_late_call): Pop after Call or CallValue when needed. (New.Emit) add emit_create_instance. 2004-11-08 Cesar Lopez Nataren * expression.cs (class New): add new operator support. Add emit_args, implemented Emit. * expression.cs: emit unary operator code. * TypeOf.cs: back to Microsoft.JScript namespace. fix typo. * Literal.cs: constrain more the case of negative numeric literal. * expression.cs (emit_func_call): pop if function's return type is non-void and has no effect. 2004-11-07 Cesar Lopez Nataren * BinaryOp.cs: added constructor for instantiating derived classes. * BitwiseBinary.cs, Equality.cs, In.cs, InstanceOf.cs, NumericBinary.cs, Plus.cs, Relational.cs, StrictEquality.cs, expression.cs (classes Binary, Assign): use inherited constructor. * BitwiseBinary.cs, Equality.cs: deleted public constructor which carried the context. 2004-10-25 Cesar Lopez Nataren * StringObject.cs: add value field * expression.cs: implement LateBinding. Added methods: emit_late_binding, init_late_binding, emit_late_get_or_set, get_global_scope_or_this, setup_late_call_args, load_script_func, emit_late_call * Convert.cs: implement CheckIfDoubleIsInteger and CheckIfSingleIsInteger 2004-10-20 Cesar Lopez Nataren * ast.cs (Function): added method emit_return_local_field, if there's a return stm inside a function we must allocate a JSLocalField indicating the return type of the function. * FunctionDeclaration.cs, FunctionExpression.cs: generate the extra JSLocalField if needed 2004-10-19 Cesar Lopez Nataren * Parser.cs: set the operator properly. 2004-10-11 Cesar Lopez Nataren * GlobalObject.cs: ported encodeURI, encodeURIComponent, decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode. * expression.cs (Call.Emit): implement IsConstructorProperty. 2004-10-06 Cesar Lopez Nataren * expression.cs: added support for function calls. Handle case of print where no args are supplied. 2004-10-05 Cesar Lopez Nataren * ast.cs: added GetContainerFunction property. * Statement.cs: added class NotVoidReturnEventArgs and delegate NotVoidReturnEventHandler, throw an event in case we find a return, the enclosing function object takes care of changing the return type of the function. * FunctionDeclaration.cs, FunctionExpression.cs: take care of return's inside functions. 2004-09-22 Cesar Lopez Nataren * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField. * Parser.cs: use ToJSToken to set the operator properly. * FunctionDeclaration.cs: delete spaces. 2004-09-21 Cesar Lopez Nataren * FunctionDeclaration.cs: check for parent being a ScriptBlock. 2004-09-20 Cesar Lopez Nataren * expression.cs: added semantic analysis for accessing fields on class Binary. Semantic Analysis for Calls it takes care of constructors and methods, added invocation code for built in methods. Added interface IAccesible that let us resolve the '.' operator. Class Args handles missing or surplus arguments. Added class BuiltIn which will take care of all builtins of ECMAScript. * ast.cs: added check for parent equal to ScriptBlock. * SymbolTable.cs: added method Remove. * Statement.cs: Added abstract class Jump of which Continue and Break inherit, checks the label stuff. Added checks for Label stuff to Continue and Break classes. Added method Init for DoWhile. Fixes for loops statements in order to be able for have nested loops. Initial support for Label statements. * SemanticAnalizer.cs: added hash global_env and IdentificationTable label_set for keeping track of global methods and label sets. Added static constructor, method BuildGlobalEnv, ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel, GetLabel, RemoveLabel. * Relational.cs: added code generation for ops instanceof and in. Fixes for usual relational ops. * Parser.cs:fixes to keep track of the inheritance chain. * MathObject.cs: added internal constructor. * JSFunctionAttribute.cs: added fields value and built_in_function so we can decide when a method is really a built in. * IdentificationTable.cs: added method Remove. * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression. 2004-08-25 Cesar Lopez Nataren * expression.cs: made Binary is IAssignable, added fields assign and right_side, added method ResolveAssign (which now receives an extra parameter, being the right side of the assigment). Take care of being inside a function for array indexing. Take care of lvalue case too. Assign.Emit just calls left.Emit since left knows everything about the right side of the assigment after Resolve process. * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change. * BinaryOp.cs: renamed current_op to op as with the new parser we no longer need to keep track of the old_op. 2004-08-24 Cesar Lopez Nataren * expression.cs: do not pass the operand as a parameter to the constructor as it gets after the parent gets constructed, same with binary. Added code generation for array index access. * Parser.cs: added ToJStoken which converts Token to JSToken, factored the code for creation the Unary nodes. Take care of parent relationship. * LateBinding.cs: back to Microsoft.JScript namespace. 2004-08-23 Cesar Lopez Nataren * Parser.cs: pass the skip_count to ArrayLiteral constructor. * Missing.cs: back to Microsoft.JScript namespace. * ArrayLiteral.cs: added field skip_count, it tells us if this is a spaced-arrayliteral, in which case we add a null value in the list, added null check in the resolve and code generation process. 2004-08-21 Cesar Lopez Nataren * expression.cs: added interface ICallable and and function AddArg to class Call. Added class New. * driver.cs: made it use the new lexer and parser. * ast.cs: added field line_number, added property InFunction, added class Function that factores all the code shared between FunctionDeclaration and FunctionExpression. * With.cs: constructor receives line number. * VariableStatement.cs: constructor receives line number. * VariableDeclaration.cs: Added check for parent being FunctionDeclaration and FunctionExpression. * Try.cs: Moved the code that used to take care of the catch to Catch class. Constructor receives forming elements and line number. Removed mangle_id. * Throw.cs: constructor receives line number. * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed identifier to label in Continue and Break class, its constructor now receives the label and line number. For class, constructor receives its forming parts. Switch class, constructor receives line number, added function AddClause and AddStm. Added class Catch. Added class Labelled. * SemanticAnalyser.cs: Added field anon_method_counter, properties NextAnonymousMethod and CurrentAnonymousMethod. * Parser.cs: function ArgumentList receives a ICallable list instead of a AST. Now we add the arguments of a callable. Build Call's ast. * Literal.cs: added constructor for 'this' literal and ObjectLiteral constructor. Added RegExpLiteral class, will take care of regular expressions semantic analysis and code generation. * JSScanner.cs: use no more the antlr based lexer. Fix typo. * JSParser.cs: make it use the new port of Rhino's Parser. * FunctionObject.cs: Added constructor that receives the function name. * FunctionExpression.cs: made it inherit from Function class. Added constructor. Factored the code that used to set the prefix to Function.set_prefix (it's shared with FunctionDeclaration). Added fields local_script_func and field. Implemented Resolve and Emit (now we can do: var x = function (this, method, is, anonymous) {... };). * FunctionDeclaration.cs: made it inherit from Function class in order to share code with FunctionExpression. Added new constructor. Moved the code that used to built the prefix to Function inside function set_prefix. When building the closure added check for setting the type of a FunctionExpression. Moved set_function_type and set_custom_attr to class Function. * ForIn.cs: added constructor and fields lhs, obj and body. * Block.cs: added default constructor and line number based constructor. Check for elems not being null before adding. * ArrayLiteral.cs: set elements in constructor. 2004-07-29 Cesar Lopez Nataren * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn, building the other block was not needed. Build the ast's for the expressions and statements, keep track of the parent relationship. 2004-07-19 Cesar Lopez Nataren * Added Token.cs, TokenStream.cs, Parser.cs which are the port of Mozilla/Rhino's parser. 2004-06-24 Cesar Lopez Nataren * jscript-lexer-parser.g: added ast building for object_literal, it's disabled for now while I fix the "block Vs object_literal" non-determinism problem on the parser. Added rule for array_literal. Build PropertyName ast build. * Literal.cs: fixed the negative numbers code generation (we must optimize this). Added initial ObjectLiteral's class, code generation and Resolve process. Added class ObjectLiteralItem and PropertyName. * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have elisions we keep track of the "real" size here. Added constructor. Added initial Resolve and Emit code. * ASTList.cs: added Size property. * Globals.cs, ASTList.cs: Back to the useful namespace (M.J). 2004-06-20 Cesar Lopez Nataren * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by break and continue in order to jump to the desired place. Added check for converting to boolean if we encounter an identifier (at need_convert_to_boolean). * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't need to jump if the expression evaluates to true. Continue class, replaced ParentIsItrStm with InLoop, emit jump to correct place. Break class, implemented Resolve; deleted ParentIsCorrect. DoWhile, While classes, set LoopBegin and LoopEnd. While class, set LoopBegin and LoopEnd. * ast.cs: Added InLoop and InSwitch. * jscript-lexer-parser.g: pass parent to break_stm. Added block as a statement. Temporarily disabled object_literal in order to test the block structure and continue and break statements. 2004-05-28 Cesar Lopez Nataren * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm property. Added initial pieces for Break's Resolve. Fixed bug that did not let Emit the code for case clauses that came after the default clause (we match the jsc behavior). * jscript-lexer-parser.g: set parent of switch's clauses. 2004-05-27 Cesar Lopez Nataren * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm * jscript-lexer-parser.g: set parent hierarchy for continue statement. Set to correct parent in iteration_stm. 2004-05-24 Cesar Lopez Nataren * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace. * Statement.cs: Added code generation support for 'switch' statement. * jscript-lexer-parser.g: added 'using' for System.Collections. Allow 'switch' statement building of its ast. Added parent parameter to constructor of With. Build inside_for ast. * With.cs: code generation support for 'with' stm. 2004-05-21 Cesar Lopez Nataren * Statement.cs: initial code generation of 'for'. * jscript-lexer-parser.g: let's build for's ast. 2004-05-18 Cesar Lopez Nataren * jscript-lexer-parser.g: let's build Try/Catch/Finally ast. * expression.cs: handle Try case for field or local vars allocation. * Try.cs: implemented Emit. * Throw.cs: implemented code generation. * FunctionDeclaration.cs: cache some values. 2004-04-26 Cesar Lopez Nataren * FunctionDeclaration.cs: let's make function name formation (get_name ()) a little bit less dumb. We cache the prefix now so we don't have to recalculate it everytime. 2004-04-22 Cesar Lopez Nataren * Literal.cs: emit the correct code for negative numbers. * jscript-lexer-parser.g: set parent unary_expr. 2004-04-18 Cesar Lopez Nataren * expression.cs: added code generation for 'x1 ? x2 :x3' op. * Statement.cs: Added code generation for while and do-while. 2004-04-17 Cesar Lopez Nataren * Statement.cs (class if): reimplemented Emit based on fall_false. * Equality.cs: added code generation for != and emit jumping code only in the case we are at a global expression not statement. * CodeGenerator.cs (fall_true, fall_false): Check if convertion to boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean. 2004-04-14 Cesar Lopez Nataren * expression.cs (Binary.Emit): treat boolean operator specially. Added emit_jumping_code. * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and fall_false, which will express all boolean expressions and control flow conditions. 2004-04-02 Cesar Lopez Nataren * Equality.cs: Moved the Emit and Resolve code here. * jscript-lexer-parser.g: Build a Equality object instead of a Binary object for equality_expr. * expression.cs: moved equality oeprators (resolve and IL gen) to Equality.Emit and Equality.Resolve. 2004-03-31 Cesar Lopez Nataren * expression.cs: Added shift operators IL emit. * BitwiseBinary.cs: added constructor for building it according to JSToken enum. return a new object on EvaluateBitwiseBinary (this needs a real implementation). * expression.cs: added code for evaluation of bitwise operators at emit_op_eval. * Statement.cs: added stub for While and DoWhile ast representation (reworking my Emit code). * jscript-parser-lexer.g: allow iteration statement ast build. * FunctionDeclaration.cs: agrouped code for setting custom attribute. * expression.cs: added Modulo operator case. 2004-03-16 Cesar Lopez Nataren * Convert.cs: added rule for string conversion. * Plus.cs: added rule for string addition. * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and Emit (cases where there's no real operator). * StringLiteral.cs: now implements Exp as can appear as a simple exp in global code. Added check for Pop generation. * expression.cs: added IL generation code for print func call. Args class added get_element, Size and made Resolve behave as the others (collect the differents Resolve's return values from each of the arguments). Expression class, added default Resolve call for non-Exp implementers. * jscript-lexer-parser.g: postfix_expr rule now returns a simple AST, this handles the case where no postOrPrefixOp present; Unary returns an AST too. * FormalParameterList.cs: added get_element, retrieves nth element. 2004-03-14 Cesar Lopez Nataren * ScriptStream.cs: let's print some messages. * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule. 2004-03-13 Cesar Lopez Nataren * jscript-lexer-parser.g: keep track of return's parent. * Statement.cs: added parent parameter to constructor. * expression.cs: refactored Emit code from Identifier, now we take care of function's paramenter references. First attack to function calls, check if Resolve from Call succeed. * VariableDeclaration.cs: Deleted Decl class, field_info and local_builder fields were being used only by VariableDeclaration, I'll keep them there. * FormalParameterList.cs: added field pos to FormalParam, and set it at FormalParameterList's Resolve stage. * TODO: updated TODO. 2004-03-07 Cesar Lopez Nataren * jscript-lexer-parser.g: build If's ast. Keep track of expr parent. * expression.cs: At class Conditional renamed fields. Class Expression inherits from Exp as we must keep track if we must pop the last value (this is for the comma operator), track the parent, at Resolve we take care of the last value of the expression, * VariableDeclaration.cs: updates needed because of EmitContext change. * Statement.cs: added parent param to If constructor. Implement Resolve and Emit for If statement. * Relational.cs: Set parent. The boxing happens in the containing statement. * FunctionDeclaration.cs: Added func_type field, will be used to determine the type of the function we are generating (global function, method from a class, etc) and attach to it the correct custom attribute. Simplified the code for nested functions: refactored the code so no code duplication is involved, now we have only one function that retrieves the name of the function, now create a new EmitContext for the body of the method. * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use current EmitContext's ILGenerator. * Convert.cs: Do not throw the NotImplementedException anymore for method ToBoolean, for now we always return false. This must get a real implementation. * CodeGenerator.cs: Deleted one of ILGenerator fields from EmitContext, suffices using only one (more notes about the change on the Functiondeclaration entry). Imitate jsc behavior for compiled files names, aggregate the exe or dll extension after last dot. * Block.cs: In order to implement the comma operator (i.e., expression, assign_exp), we must track if our expressions are at a global scope, in which case we must pop the last result too. 2004-01-25 Cesar Lopez Nataren * Relational.cs: Initial generation of CIL for relational operators. 2004-01-23 Cesar Lopez Nataren * jscript-lexer-parser.g: formal_param_list receives a parent too. * SymbolTable.cs: added size and current_symbols properties. * JSLocalField.cs: don't throw not ImplementedException from constructor (same reason, testing purposes, must get implemented for real). * IdentificationTable.cs: added num_of_locals and current_locals properties. * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry as fields. Not throw NotImplementedException for JScriptFunctionDeclaration (testing purposes, must get implemeted for real). Let's build our function closures! Added functions: build_closure and build_closure_nested, build_local_fields. Keep track of current parameters and locals defs. * FormalParameterList.cs: made FormalParam inherit from AST. Implement the Emit for parameters, yeah! * CodeGenerator.cs: added a ModuleBuilder reference. New constructor. * Closure.cs: do not throw the exception (this allow me to run the tests at mcs/jtests and check that at least i'm not generating invalid CIL). Be aware that this must be really implemented. * Block.cs: renamed field, and implement the double pass for nested function declarations code emittion, yeah!. 2004-01-16 Cesar Lopez Nataren * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr. * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr, * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr. * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr. * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent. * UnaryOp.cs: inherit from Exp now. * Plus.cs: Don't throw the exception when calling constructor, let it build the default handler. Return a new object when calling EvaluatePlus until properly implemented. * NumericUnary.cs: added new Resolve. * NumericBinary.cs: assign operator val at ctr. Return a new object when calling EvaluateNumericBinary until properly implemented. Added Resolve. * Equality.cs: added ctr and return false for EvaluateEquality until properly implemented. Added Resolve's functions. * Block.cs (Resolve): That check was not necessary. * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs, StrictEquality.cs, TypeOf.cs: added Resolve inherited from BinaryOp and UnaryOp, and this from Exp. * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages. * jscript-lexer-parser.g: deleted debugging messages. Create a Assign object instance of a simple Binary obj. Same case for Equality. * expression.cs: added Exp abstract class. Classes that are ast of language constructions that can appear as global expressions that get evaluated and then the result is discarded inherit from this new class. This let meee keep track of things that must get Popped or can even avoid the evaluation of it. Wrote real Resolve method for classes: Unary, Binary. Implemted Emit method for some binary operations (+, -, / and *), for other operators some more code is still missing. Identifier: handle assignment cases and global exp cases. Added class Assign (compisite assignment still missing tough :-( * driver.cs: deleted debug messages, added "Compilation Succeeded" message ;-). * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method. * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from Exp and handle the case for global expressions that must be popped after evaluation. no more invalid IL being generated! yeah! * Block.cs: wrote real Resolve method, erased debug messages. * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp. * BinaryOp.cs, Conditional: now inherits from Exp. 2004-01-15 Cesar Lopez Nataren * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript. * CodeGenerator.cs: small fixes to generate same things that ms. 2004-01-13 Cesar Lopez Nataren * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder. 2004-01-12 Atsushi Enomoto * JSMethodInfo.cs : tiny fix for NET_2_0 build. 2003-12-24 Cesar Lopez Nataren * jscript-lexer-parser.g: keep track of parent reference for IDENTIFIER, STRING_LITERAL. * expression.cs: Added 'binding' field. Added 'parent' parameter to constructor. Now we emit the proper code for the identifier. * VariableStatement.cs: updated to field names instead of the old property's name. * VariableDeclaration.cs: Added class Decl, it constains the references to the static field or LocalBuilder that are created when a declaration is emitted. Deleted unuseful properties (Id, InitValue, Type). * SymbolTable.cs: Deleted Retrieve method. Contains now returns an object instead of a boolean. * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig. * IdentificationTable.cs: Deleted Retrieve method. Contains method now return an object instead of a boolean, that reference is the binding associated with the identifier being searched. 2003-12-18 Cesar Lopez Nataren * jscript-lexer-parser.g: Keep track of parent for numeric_literal. * VariableDeclaration.cs: now I handle initialization (ex. var x = 2; or function f () { var x = 4; }) at global scope or at function's body. * Literal.cs: Added parent param to NumericLiteral constructor. * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies. 2003-12-17 Cesar Lopez Nataren * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'. 2003-12-10 Cesar Lopez Nataren * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF = "instanceof"; }' in order to be able to parse both keywords. When generating the parser, one warning about nondeterminism (k==1:"in") is generated ignore it. 2003-12-07 Cesar Lopez Nataren * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were not parsable now they are. Mozilla's and Janet's test suites are being really helpful. 2003-12-05 Cesar Lopez Nataren * jscript-lexer-parser.g: added check for non-null reference at var_decl_list rule. Added single quote STRING_LITERAL lexical rule and multiple lines comments rule. * jscript-lexer-parser.g: Now I keep track of the parent for most of the syntatic constructs. Fixed object_literal rule. * ast.cs: Added field parent. This will help me to track nested blocks for all of the syntatic constructs and will allow to Emit everything in one single pass. * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the parent stuff. * Block.cs, FunctionObject.cs: deleted parent field as AST will hold it. Delete parent parameter from constructor. * CodeGenerator.cs: Add field gc_ig (global code IL generator) to EmitContext class. The idea is Emitting everything in one pass (decls and 'Global Code' method, the parent reference let me know which IL generator use, gc_ig or ig). * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to constructor. Use new parent reference for choosing the IL generator. NumericLiteral a 'hard coded' int32 IL emittion added for testing. * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use the parent reference to infere which IL generator to use. * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent reference to infer which IL generator to use. * expression.cs: Added paramenter parent to constructor of: Unary, Binary, Conditional, Call. 2003-11-30 Cesar Lopez Nataren * expression.cs: Added new field to Call class, so it can handle more arguments. * StringLiteral.cs (Emit) : Load the string value. * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean. * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set custom attribute. Build default 'JScript 0' constructor. Emit default initial/final code of 'Global Code'. Create default 'JScript Main'. 2003-11-29 Cesar Lopez Nataren * jscript-lexer-grammar.g: define new rule 'arguments' instead of repeating hand written rule all around. Change "." for DOT, dumb mistake by myself. Added rule new_expr. Now we handle properly the call_expr rule (as defined on the spec), and added a new argument. Added subrule new_expr to left_hand_side_expr rule. 2003-11-27 Cesar Lopez Nataren * expression.cs (Expression): implemented Emit. * expression.cs (Binary): Emit now creates a local for the different kinds of binary expressions (initial code for this). * ast.cs: Emit method now is abstract instead of virtual. * CodeGenerator.cs: changed no_global_code_method to is_global_code_method. * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs, FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs, NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs, Continue, Break, Return, StrictEquality.cs, StringLiteral.cs, Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, Conditional, Call, Identifier, Args, Expression, : added Emit method. * FunctionDeclaration.cs: Check if values are not null first (at Resolve). Ignore code generation is at 'Global Code'. * VariableDeclaration.cs: Now I take care of IL generation when we are at statements and expressions at global code, 'Global Code' method is populated with that IL. * CodeGenerator.cs: Added flag for 'Global Code' method emittion. Now I call 'Emit' twice. The first for declarations the follower for statements and expressions at global scope. 2003-11-10 cesar lopez nataren * Visitor.cs: Deleted. 2003-11-09 cesar lopez nataren * FormalParameterList.cs: Now inherits from AST. Each of the formal parameters gets into the IdentificationTable at Resolve. * FunctionDeclaration.cs:Resolve (), We open a new block when encountering a FunctionDeclaration, resolve de parameters and the body, at the end we close the block. * IdentificationTable.cs: Now we keep track of parent of the current block. 'Enter (...)' now receives an object, not a VarDecl. 'Contains' now take care of searching through the binding chain. * Literal.cs: Deleted 'Literal' class, was being used for nothing. All the classes the inherited from it, now do it from AST. A 'literal' does resolve to true by default. * Relational.cs: Resolve recursively left and right. * SemanticAnalyser.cs: added flag for 'print statement'. * Statement.cs: 'If' class, resolves firstly the condition, the true_stm and false_stm. * driver.cs: Init the semantic analysis phase. * expression.cs: 'Unary' class, resolves its operand first. 'Binary' class,resolves left and right first. 'Args' class resolve all the formal parameters first. 'Expression' resolve all the nested expressions first. * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones. 2003-11-08 cesar lopez nataren * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL, this is temporal in order to get Factorial compiled by mjs (must build the types according to Ecma-262 spec). * Literal.cs: Added NumericLiteral class. 2003-11-06 cesar lopez nataren * FunctionDeclaration.cs: Build a ScriptFunction local variable, if inside a nested block. 2003-11-05 cesar lopez nataren * jscript-lexer-parser.g: Now we take care of parents. This allows to keep track if we are inside nested blocks. At 'func_decl_or_expr', now I built the FunctionDeclaration or FunctionExpression first and then assign its body to it - this let me get a non-null value of the FunctionExpression or FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!). * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field. * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor. * ScriptBlock.cs: Initiate the global block with 'null' as parent. * FunctionDeclaration.cs: Added 'get_composite_name ()' method (gets the name of a function if it's nested). Emit code for function's body. At 'Emit ()' now we take care if it's a nested declaration. * FunctionObject.cs: default return type is 'void' not 'Object'. Function declarations without parameters map to functions with 'Object this' and 'VsaEngine engine' as parameters by default. Assign parent to nested block. * VariableDeclaration.cs: At 'Emit ()', now we take care if we are a global declaration or inside a function declaration. 2003-11-04 cesar lopez nataren * FunctionObject.cs: Handle no parameters on functions. * jscript-lexer-parser.g: Allow functions without parameters. 2003-11-03 cesar lopez nataren * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs, DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FunctionDeclaration.cs, FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs, With.cs, expression.cs : Added 'Resolve' method stub. * CodeGenerator.cs: Added a ILGenerator field to EmitContext. * FormalParameterList.cs: Added FormalParam class. Change Add method to receive the id and the type annotation from function's parameters. * FunctionDeclaration.cs: Added code for initial function's definition code generation. * FunctionObject.cs: Added MethodAttributes and type_annot fields. Added params_types function, which returns an array of types from each of the function's parameters. * IdentificationTable.cs: Added ToString method. * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it and add it again with the correct name). Not based on the Visitor pattern anymore. Deleted all the VisitFOO methods. Added a IdentificationTable field. Added Run, Dump methods. * Statement.cs: Deleted Statement class (it was being used for nothing). All classes that were having Statement as parent, changed their parent to be AST. * SymbolTable.cs: Added Add method that receives the id and the declaration class. Retrieve changed to return an AST. Added ToString method. Added 'SymbolTable parent' field. * VariableDeclaration.cs: Added InitValue property. * ast.cs: Added some comments and abstract method 'Resolve'. * jscript-lexer-parser.g: Added parsing support for formal parameters type annotations. 2003-10-30 cesar lopez nataren * jscript-lexer-parser.g: fixed function call parsing! yeah! (give thanks to Hector!) 2003-10-28 cesar lopez nataren * jscript-lexer-parser.g: allow empty program files. Added type annotations on var decl and function decl. * VariableDeclaration.cs: added return type annotation field. * FunctionExpression.cs: added return type parameter to constructor. * FunctionDeclaration.cs: added return type parameter to constructor. Added Emit method (just creates the static field at the global object, for now). * FunctionObject.cs: added return type to constructor. Changed names to readable ones ;-) * ScriptStream.cs: added WriteLine. 2003-10-24 cesar lopez nataren * ast.cs: Added 'virtual' Emit method (I might change it to be abstract, but I would have to added to all classes that derive from it. I'll do it later) * Block.cs: Added Emit method. * CodeGnerator.cs: Restructured it (not based on the Visitor pattern anymore) - still missing some methods, ut on the way. A nice hacking weekend coming. Added EmitContext class. * ScriptBlock.cs: Added Emit method. * VariableDeclaration.cs: Changed type field from string to Type. Added Emit method. * VariableStatement.cs: Added Emit method. * driver.cs: Added CodeGeneration phase (only simple var declarations support it. More coming soon). 2003-10-22 cesar lopez nataren * statement.cs: added Return class. * Throw.cs: Added expression field, constructor and ToString. * jscript-lexer-parser.g: Allow return_stm and throw_stm tree building. * With.cs: added constructor and ToString. Back to the non-tmp namespace. * jscript-parser-lexer.g: allow with_stm tree building. * jscript-lexer-parser.g: changed the return type from if_stm from 'If' to AST. Added tree for continue_stm. Allowed building of Break tree. * statement.cs: switched to internal 'If' class. Added Continue class. Added Break class. * jscript-lexer-parser.g: build tree for function decl or expr. * FunctionDeclaration.cs: added internal constructor. * FunctionExpression.cs: added internal constructor. * FunctionObject.cs: added internal constructor and ToString method. * jscript-lexer-parser.g: added building tree for if_stm. * Statement.cs: Added if class for 'if' statement. 2003-10-21 cesar lopez nataren * VariableDeclaration.cs: added the initializer to ToString. * jscript-lexer-parser.g: Allow "christmas trees" (aka expression trees) building. * Block.cs, Equality.cs, Relational.cs: modified ToString * Equality.cs, Relational.cs, StringLiteral.cs, VariableDeclaration.cs: Added constructor * VariableStatement.cs, ScriptBlock.cs: changed from hungarian name convetion style to mono style. * UnaryOp.cs: added operator and operand fields. * VariableDeclaration.cs: chenged field name from assignExp to val. * BinaryOp.cs: Made "internal" the attributes, added the two operators holders. * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes. * driver.cs: Dump the string representation of the parsed exps. * Literal.cs: added BooleanLiteral * Relational.cs: added constructor, ToString, 2003-10-10 cesar lopez nataren * README: added some info about hacking the grammar * JSparser.cs: Updated the constructor to not receiving params. * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs, JScriptParserTokenTypes.txt: update of antlr generated files from grammar changes. * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we can parse a little bit more useful programs like: function factorial (i) { var k; if (i <= 0) return 1; else { k = factorial (i - 1); return i * k; } } var x; x = factorial (4); print (x); As you can see, it's not the classic factorial function definition, I still have to make some tricks like storing the result from the recursive call and then multiply. But this new grammar it's easier to alter than the old one. Also we got support for for-in statements, for statements, global expressions, support for object accesors or better known as the "dot" operator. Two rules are on the eye: left_hand_size_expr and call_expr, in order to finish the parsing grammar and fix the bugs. 2003-09-29 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs * Added VsaItem.cs, implements IVsaItem. 2003-09-28 * VsaItems.cs: Check that no name is repeated (this was docs fault :-)). This is the beauty of testing. * Add VsaItems.cs, implements IVsaItems. 2003-09-22 * DocumentContext.cs: changed constructor from internal to public, this a kind of hack ;), but we can build mjs.exe with that change. * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs, VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs, StringLiteral.cs, StringConstructor.cs, Statement.cs, ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs, ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs, Package.cs, ObjectConstructor.cs, NumberObject.cs, NumberConstructor.cs, MathObject.cs, Literal.cs, LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs, JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs, JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs, JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs, IActivationObject.cs, GlobalScope.cs, GlobalObject.cs, FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs, FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs, ErrorConstructor.cs, EnumeratorObject.cs, EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs, DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs, BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs, BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs, ActiveXObjectConstructor.cs, ActivationObject.cs: indentation comformance to mono style. Returned to Microsoft.JScript namespace name. Now we can build Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on linux/Windows with our Microsoft.JScript.dll. To build mjs.exe: $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind about the namespace stuff, because I want people to contribute NUnit tests for Microsoft.JScript public API. * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace. 2003-09-21 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement. 2003-09-20 * jscript-lexer-parser.g: We are little bit closer to the spec on StringLiteral definition. * jscript-lexer-parser.g: One line patch, the beauty of tests :-) * jscript-lexer-parser.g: Build ast for FunctionExpression. * JSObject.cs: we don't throw NotImplementedException anymore, this let us use FunctionExpression to build the ast. * FunctionExpression.cs: Added a FunctionObject as field, a default constructor. * FunctionObject.cs: Added default constructor. * driver.cs: Deleted the Jsc class. We are not generating code now. I'm moving to provide something like mcs's EmitContext instead of the CodeGenerator class having the Reflection.Emit builders and ILGenerator. This driver is just for Lexical and Parsing phases testing. * driver.cs: Now we are using the Microsoft.JScript public API functions to load the lexer and parser. * ScriptBlock.cs,Block.cs: Added ToString function. 2003-09-20 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs, DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs, Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs, : erased Visit method and made some mono indentation style changes. * CodeGenerator.cs: commented some function calls. * FunctionDeclaration.cs: moved function attributes to FunctionObject class, erased Visit method. * FunctionObject.cs: Here is where we store a function expression/declaration info, erased Visit method. * ScriptBlock.cs: Added a Block field, Block will contain the source elements. * jscript-lexer-parser.g: updated the grammar to build the program representation based on ScriptBlock. 2003-09-19 * JSToken.cs: public API compliance. 2003-09-07 Cesar Lopez Nataren * Context.cs: Added constructor and Document field. * DocumentContext.cs: Added Name field. * JSParser.cs: Integration of antlr's generated parser with JSParser public API. ScriptBlock is now the principal data structure that represents a Jscript .Net program. * JSScanner.cs: Integration of antlr's generated lexer with JSScanner public API. 2003-07-27 Cesar Lopez Nataren * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs. 2003-07-27 Cesar Lopez Nataren * jscript-lexer-parser.g: Changed the namespace to Microsoft.JScript.Tmp. * jscript-lexer-parser.g: Fixwd a typo at source_elements rule. * jscript-lexer-parser.g: Got the name of a global_function_declaration and also its return type if available. * jscript-lexer-parser.g: Added syntatic rule for print_statement. * jscript-lexer-parser.g: Initial construction of AST for enum_statement and package_statement. * jscript-lexer-parser.g: Fixed the enum_statement to accept empty enum declarations. * jscript-lexer-parser.g: Got the type of a veriable_declaration. * jscript-lexer-parser.g: Initial construction of AST for primary_expression (in particular literal). 2003-07-27 Cesar Lopez Nataren * driver.cs: Modified the driver structure to be compatible with our new CodeGenrator and SemanticAnalizer. I removed the builders from Reflection.Emit to the CodeGenerator. Added an ASTList, SemanticAnalizer and CodeGenerator here. Adde methods Run, GenerateCode 2003-07-27 Cesar Lopez Nataren * Statement.cs: Forgot to include it on last commit. 2003-07-27 Cesar Lopez Nataren * Decided to change temporarly namespace name Microsoft.JScript to Microsoft.JScript.Tmp in order to be able to run the code generated by our CIL code generator (on next commit will come). The problem is that we don't have the runtime support for our compiler, this involve VsaEngine class and its "friends", which I have not found a lot of doumentation for. If someone knows a docs place for them, don't hesitate to send me a email pointing to them. * Changed from public to internal Visit function at some classes. * Package.cs: Added Name and Members fields. * SemanticAnalizer.cs: Added methods VisitPrint and VisitStringLiteral. * VariableDeclaration.cs: Added Type field. * Visitor.cs: Changed from public to internal. Added VisitPrint and VisitStringLiteral methods. * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp. 2003-07-22 Cesar Lopez Nataren * Added CmdLineError.cs and JSError.cs, last night I forgot to commit them. 2003-07-21 Cesar Lopez Nataren * Added files: ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs, BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs, CmdLineException.cs, CmdLineOptionParser.cs, ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs, DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs, ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs, FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs, Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs, JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs, JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs, LenientArrayPrototype.cs, LenientBooleanPrototype.cs, LenientDateConstructor.cs, LenientDatePrototype.cs, LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs, LenientFunctionPrototype.cs, LenientMathObject.cs, LenientNumberPrototype.cs, LenientObjectPrototype.cs, LenientRegExpPrototype.cs, LenientStringConstructor.cs, LenientStringPrototype.cs, LenientVBArrayPrototype.cs, MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs, NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs, NumericUnary.cs, ObjectPrototype.cs, Plus.cs, PostOrPrefixOperator.cs, RangeErrorObject.cs, ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs, RegExpPrototype.cs, Relational.cs, ResInfo.cs, ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs, StackFrame.cs, StrictEquality.cs, StringPrototype.cs, SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs, TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs, URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs, VersionableAttribute.cs Now, I must fill in the blanks :-) 2003-07-09 Cesar Lopez Nataren * jscript-lexer-parser.g: Added conditional_compilation_directive, which is the beginning of our support for conditional compilation statements and directives in our parser. Added cc_on_statement, and some lexer rules for getting the needed tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION, COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON. 2003-07-03 Cesar Lopez Nataren * jscript-lexer-parser.g: Changed the format of copyright notice. This changes will allow the support for the grammar added by MS to EcmaScript (aka its JScript .Net), I'm still missing some, but they are on the way. * jscript-lexer-parser.g: Deleted function_declaration, and added global_function_declaration and type_function_declaration. I decided to make the grammar as strict as the MS docs mark, but there's a difference between what their docs says and what their compiler does. For this case I decided to follow the docs. A program like: private function F () {} according to the docs, would not be syntaticly correct. But the MS compiler, accepts the grammar construct and mark the error at semantic analysis phase. I followed the docs this time. * jscript-lexer-parser.g: Added debbuger_statement. * jscript-lexer-parser.g: Added import_statement. * jscript-lexer-parser.g: Added package_statement and package_member(s). * jscript-lexer-parser.g: Added super_statement. * jscript-lexer-parser.g: Added const_statement. * jscript-lexer-parser.g: Added class_statement, interfaces_list and class_members. * jscript-lexer-parser.g: Added interface_statement and interface_members. * jscript-lexer-parser.g: Added enum_statement. * jscript-lexer-parser.g: Added static_statement. The rule for this syntatic construc is: static identifier { [body] } body does not get well specified in the docs. Must search wich are the possible values of it. * jscript-lexer-parser.g: At variable_declaration, added support for explicit type declaration. * jscript-lexer-parser.g: Added numeric_literal, DECIMAL_LITERAL and HEX_INTEGER_LITERAL. * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier. 2003-06-09 Cesar Lopez Nataren * Added the Visit method to classes: AST, ArrayLiteral, ASTList, Block, DebugBreak, Eval, ForIn, FunctionDeclaration, FunctionExpression, Import, Package, ScriptBlock, Throw, Try, With, That method will be the driver that will allow classes that implement the Visitor interface do a walk through the AST's elements, in particular the Semantic Analizer and the Code Generator. Every class that inherits from AST will have a Visit method, that method will receive a Visitor and a object as parameters, the only thing that it'll do is letting the Visitor call the respective method VisitX, where X is the name of the currently visited class. * ASTList.cs:Added constructor, Add, Visit, ToString methods. * FunctionDeclaration.cs: Added constructor, Visit and ToString methods. * jscript-lexer-parser.g: Added a ASTList as a parameter to the program (the main entry of the parser). Also added as parameters: - An AST to source_element. - A Statement to statement. - A VariableStatement to variable_statement. - A VariableStatement to variable_declaration_list. - A FormalParamerList by formal_parameter_list. - A ASTList by function_body. And now some rules return objects: - A VariableDeclaration by variable_declaration. - A Functiondeclaration by function_declaration. * driver.cs: Added the construction of the AST of the EcmaScript program. * Visitor.cs: Added this file. It's the visitor interface. * VariableDeclaration.cs: Added this class, it's the AST representation of a variable declaration. * Statement.cs: Added this file. It's the logical representation of a Statement. * VariableStatement.cs: Added this class. It's the AST representation of a chain of variable declarations. * FormalParameterList.cs: The function declaration needs to store its parameter, we will put them on this class. * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to implement the semantic analysis and code generation phases. SemanticAnalizer and CodeGenerator will implement the Visitor interface, they will walk a program's AST tree and do their respective work. * IdentificationTable.cs: Added this class. The SymbolTable will be used by the SemanticAnalyzer in order to keep track of the variable declaration encountered, etc.. * SymbolTable.cs: A simple hashtable but for commodity i'll call it this way. 2003-05-03 Cesar Lopez Nataren * jscript-lexer-parser.g: - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN, ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN, SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN, BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN. - Changed INTERROGATION to CONDITIONAL. - Changed TRIANGLE to BITWISE_XOR. - Changed SLASH to DIVISION. - Changed PERCENT to REMAINDER. - Changed ADMIRATION to LOGICAL_NOT - Added BITWISE_NOT (~). - Added the INCREMENT and DECREMENT rules for left_hand_side_expression. - Increased lexer lookup from 2 to 4. - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES, BITWISE_AND, BITWISE_OR, - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS, REMAINDER, UNSIGNED_RIGHT_SHIFT. - Added the recursion rules for equality_expression. - Added the recursion rules for shift_expression. - Now we skip tabs. - The most important thing, added support for expressions like: sdf.[hgh], cool! 2003-04-20 Cesar Octavio Lopez Nataren * driver.cs: - Erased the Context class, it was used for the first test of the print_statement and Reflection.Emit. As I erased the Program, SourceElements, SourceElement from the ANTLR grammar (for the rework of the AST tied to the MS JScript public API), I erased some uses in here. - Erased the methods: EmitJScript0Type, EmitJScript0Cons, EmitGlobalCode, EmitJScript0, EmitJScriptMainType, EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain, Emit. * jscript-lexer-parser.g: - Erased the references to the classes Program, SourceElements, SourceElement, Statement, FunctionDeclaration and erased print_statement rule. * JSCriptLexer.cs JScriptParser.cs and the other files generated by antlr, reflect changes from the grammar changes. 2003-04-19 Cesar Octavio Lopez Nataren * Added stubs for the classes: ASTList.cs ActivationObject.cs ActiveXObjectConstructor.cs ArrayConstructor.cs ArrayLiteral.cs ArrayObject.cs AssemblyCustomAttributeList.cs BaseVsaEngine.cs BinaryOp.cs Binding.cs Block.cs BooleanConstructor.cs BooleanObject.cs Closure.cs Context.cs DateConstructor.cs DateObject.cs DebugBreak.cs Empty.cs EnumeratorConstructor.cs EnumeratorObject.cs ErrorConstructor.cs ErrorObject.cs Eval.cs ForIn.cs FunctionConstructor.cs FunctionDeclaration.cs FunctionExpression.cs FunctionObject.cs GlobalObject.cs GlobalScope.cs IActivationObject.cs IRedirectOutput.cs IVsaScriptScope.cs Import.cs JSBuiltIn.cs JSField.cs JSFunctionAttribute.cs JSFunctionAttributeEnum.cs JSLocalField.cs JSObject.cs JSToken.cs JSVariableField.cs LenientGlobalObject.cs MathObject.cs NumberConstructor.cs NumberObject.cs ObjectConstructor.cs Package.cs RegExpConstructor.cs RegExpObject.cs ScriptBlock.cs ScriptFunction.cs ScriptObject.cs StringConstructor.cs StringObject.cs Throw.cs Try.cs UnaryOp.cs VBArrayConstructor.cs VsaEngine.cs With.cs 2003-04-11 Cesar Octavio Lopez Nataren * jscript-lexer-parser.g: - Added rules for: continue_statement, break_statement, return_statement, throw statement (all of them do not ensure that no LineSeparator appears between the keyword on the left and the identifier, expression or semicolon on the right, that must be fixed). - Added single line comments rule. 2003-04-08 Cesar Octavio Lopez Nataren * jscript-lexer-parser.g: Added syntatic rule for: - if_statement. - while and for-in subrules of iteration_statement. - Added array_literal - got tricky - I just could get the simplest rule going :) - Added elision. 2003-04-08 Cesar Octavio Lopez Nataren * jscript-lexer-parser.g: - Syntatic rule for iteration_statement. - "do" subrule for it. - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" | "in") relational_expression | ) rule to relational_expression. -Added function_expression syntatic rule. - Added STRING_LITERAL to literal rules. - "Less/Greater or equal than" lexer rule. 2003-04-03 Cesar Octavio Lopez Nataren * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp. 2003-04-01 Cesar Octavio Lopez Nataren * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression. 2003-03-30 Cesar Octavio Lopez Nataren * Added a README file. Explains the dependencies and build process. 2003-03-30 Cesar Octavio Lopez Nataren * Added this ChangeLog file. * ast.cs: Added this file. Contains the classes used for building the EcmaScript 's AST. * JScript*: These are the files generated by antlr (the parser generator). * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript. * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods, that will be moved to other file in the future. * jscript-lexer-parser.g: The EcmaScript's antlr grammar.