dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/JScript/Jsc ASTList.cs,NONE,1.1 Array


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/JScript/Jsc ASTList.cs,NONE,1.1 ArrayLiteral.cs,NONE,1.1 AssemblyCustomAttributeList.cs,NONE,1.1 BinaryOp.cs,NONE,1.1 Binding.cs,NONE,1.1 BitwiseBinary.cs,NONE,1.1 BreakOutOfFinally.cs,NONE,1.1 ContinueOutOfFinally.cs,NONE,1.1 DebugBreak.cs,NONE,1.1 Equality.cs,NONE,1.1 Eval.cs,NONE,1.1 Expando.cs,NONE,1.1 ForIn.cs,NONE,1.1 FunctionDeclaration.cs,NONE,1.1 FunctionExpression.cs,NONE,1.1 Globals.cs,NONE,1.1 Import.cs,NONE,1.1 In.cs,NONE,1.1 Instanceof.cs,NONE,1.1 LateBinding.cs,NONE,1.1 Makefile,NONE,1.1 MemberInfoList.cs,NONE,1.1 MethodInvoker.cs,NONE,1.1 Namespace.cs,NONE,1.1 NumericBinary.cs,NONE,1.1 NumericUnary.cs,NONE,1.1 Package.cs,NONE,1.1 Plus.cs,NONE,1.1 PostOrPrefixOperator.cs,NONE,1.1 ReferenceAttribute.cs,NONE,1.1 Relational.cs,NONE,1.1 ReturnOutOfFinally.cs,NONE,1.1 StrictEquality.cs,NONE,1.1 Throw.cs,NONE,1.1 Try.cs,NONE,1.1 Typeof.cs,NONE,1.1 UnaryOp.cs,NONE,1.1 With.cs,NONE,1.1
Date: Mon, 13 Jan 2003 05:53:23 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/JScript/Jsc
In directory subversions:/tmp/cvs-serv3129/JScript/Jsc

Added Files:
        ASTList.cs ArrayLiteral.cs AssemblyCustomAttributeList.cs 
        BinaryOp.cs Binding.cs BitwiseBinary.cs BreakOutOfFinally.cs 
        ContinueOutOfFinally.cs DebugBreak.cs Equality.cs Eval.cs 
        Expando.cs ForIn.cs FunctionDeclaration.cs 
        FunctionExpression.cs Globals.cs Import.cs In.cs Instanceof.cs 
        LateBinding.cs Makefile MemberInfoList.cs MethodInvoker.cs 
        Namespace.cs NumericBinary.cs NumericUnary.cs Package.cs 
        Plus.cs PostOrPrefixOperator.cs ReferenceAttribute.cs 
        Relational.cs ReturnOutOfFinally.cs StrictEquality.cs Throw.cs 
        Try.cs Typeof.cs UnaryOp.cs With.cs 
Log Message:


Perform the initial check-in of the JScript implementation (requires
treecc 0.2.0 or higher).


--- NEW FILE ---
/*
 * ASTList.cs - List of AST values.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class ASTList : AST
{
        // Constructor.
        internal ASTList() : base() {}

}; // class ASTList

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * ArrayLiteral.cs - Literal array values.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class ArrayLiteral : AST
{
        // Constructor.
        public ArrayLiteral(Context context, ASTList elements)
                        : base(new JArrayLiteral(context, 0))
                        {
                                // Doesn't need to add the elements because 
there is
                                // no way for callers to create an ASTList to 
add!
                        }

}; // class ArrayLiteral

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * AssemblyCustomAttributeList.cs - Custom attributes for assemblies.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class AssemblyCustomAttributeList : AST
{
        // Constructor.
        internal AssemblyCustomAttributeList() : base() {}

}; // class AssemblyCustomAttributeList

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * BinaryOp.cs - Common base class for binary operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;

// Dummy class for backwards-compatibility.

public abstract class BinaryOp : AST
{
        // Internal state.
        protected JSToken operatorTok;

        // Constructor.
        internal BinaryOp(int operatorTok) : base()
                        {
                                this.operatorTok = (JSToken)operatorTok;
                        }

        // Find the operator method to use on two types.
        protected MethodInfo GetOperator(IReflect ir1, IReflect ir2)
                        {
                                // Never used.
                                return null;
                        }

}; // class BinaryOp

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Binding.cs - Handle binding operations.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;
using System.Reflection.Emit;

// Dummy class for backwards-compatibility.

public abstract class Binding : AST
{
        // Constructor.
        internal Binding() : base() {}

        // Determine if a value is "Missing".
        public static bool IsMissing(Object value)
                        {
                                return (value is Missing);
                        }

        // Get the object for this binding.
        protected abstract Object GetObject();

        // Handle "no such member" errors.
        protected abstract void HandleNoSuchMemberError();

        // Resolve the right-hand part of a binding.
        protected void ResolveRHValue()
                        {
                                // Never used.
                        }

#if !ECMA_COMPAT

        // Translate this binding object into IL.
        protected abstract void TranslateToILObject
                        (ILGenerator il, Type obtype, bool noValue);
        protected abstract void TranslateToILWithDupOfThisOb(ILGenerator il);

#endif // !ECMA_COMPAT

}; // class Binding

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * BitwiseBinary.cs - Bitwise binary operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;

// Dummy class for backwards-compatibility.

public sealed class BitwiseBinary : BinaryOp
{
        // Constructor.
        public BitwiseBinary(int operatorTok)
                        : base(operatorTok)
                        {
                                // Nothing to do here.
                        }

        // Evaluate a bitwise binary operator on two values.
        public Object EvaluateBitwiseBinary(Object v1, Object v2)
                        {
                                // TODO
                                return null;
                        }

}; // class BitwiseBinary

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * BreakOutOfFinally.cs - Exception to break out of a "finally" block.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

public sealed class BreakOutOfFinally : ApplicationException
{
        // Accessible internal state.
        public int target;

        // Constructor.
        public BreakOutOfFinally(int target)
                        {
                                this.target = target;
                        }

}; // class BreakOutOfFinally

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * ContinueOutOfFinally.cs - Exception to continue out of a "finally" block.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

public sealed class ContinueOutOfFinally : ApplicationException
{
        // Accessible internal state.
        public int target;

        // Constructor.
        public ContinueOutOfFinally(int target)
                        {
                                this.target = target;
                        }

}; // class ContinueOutOfFinally

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * DebugBreak.cs - Breakpoint for debugging purposes.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class DebugBreak : AST
{
        // Constructor.
        internal DebugBreak() : base() {}

}; // class DebugBreak

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Equality.cs - Equality operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;

// Dummy class for backwards-compatibility.

public sealed class Equality : BinaryOp
{
        // Constructor.
        public Equality(int operatorTok)
                        : base(operatorTok)
                        {
                                // Nothing to do here.
                        }

        // Evaluate an equality operator on two values.
        public bool EvaluateEquality(Object v1, Object v2)
                        {
                                // TODO
                                return false;
                        }

        // Determine if two JScript objects are equal.
        public static bool JScriptEquals(Object v1, Object v2)
                        {
                                // TODO
                                return false;
                        }

}; // class Equality

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Eval.cs - Evaluate a JScript statement that is provided by string.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

// Dummy class for backwards-compatibility.

public sealed class Eval : AST
{
        // Constructor.
        internal Eval() : base() {}

        // Evaluate a JScript expression in the context of a specific engine.
        public static Object JScriptEvaluate(Object source, VsaEngine engine)
                        {
                                Object value = null;

                                // Bail out if we weren't supplied a string.
                                if(!(source is String))
                                {
                                        return source;
                                }

                                // Parse the "eval" statement.
                                Context context = new Context((String)source);
                                context.codebase = new CodeBase("eval code", 
null);
                                JSParser parser = new JSParser(context);
                                JNode node = parser.ParseSource(true);

                                // Push a scope for use during evaluation.
                                engine.PushScriptObject
                                        (new 
BlockScope(engine.ScriptObjectStackTop(),
                                                                        new 
JSObject (null, engine)));

                                // Evaluate the statement.
                                try
                                {
                                        value = node.Eval(engine);
                                        if(value == Empty.Value)
                                        {
                                                value = null;
                                        }
                                }
                                catch(JScriptException e)
                                {
                                        // Attach the context information to 
low-level exceptions.
                                        if(e.context == null)
                                        {
                                                e.context = context;
                                        }
                                        throw;
                                }
                                catch(BreakJumpOut brk)
                                {
                                        // "break" used incorrectly.
                                        throw new 
JScriptException(JSError.BadBreak, brk.context);
                                }
                                catch(ContinueJumpOut cont)
                                {
                                        // "continue" used incorrectly.
                                        throw new 
JScriptException(JSError.BadContinue,
                                                                                
           cont.context);
                                }
                                catch(ReturnJumpOut ret)
                                {
                                        // "return" used incorrectly.
                                        throw new 
JScriptException(JSError.BadReturn, ret.context);
                                }
                                finally
                                {
                                        // Pop the script scope.
                                        engine.PopScriptObject();
                                }

                                // Return the result of the evaluation to the 
caller.
                                return value;
                        }

}; // class Eval

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Expando.cs - Mark a class or method as "Expando".
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method,
                            Inherited=true)]
public class Expando : Attribute
{
        // Constructor.
        public Expando() {}

}; // class Expando

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * ForIn.cs - Node type that implements "for ... in ..." statements.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Collections;

// Dummy class for backwards-compatibility.

public sealed class ForIn : AST
{
        // Constructor.
        internal ForIn() : base() {}

        // Get an appropriate JScript enumerator for a collection.
        public static IEnumerator JScriptGetEnumerator(Object coll)
                        {
                                // TODO
                                return null;
                        }

}; // class ForIn

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * FunctionDeclaration.cs - Function declaration nodes.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Collections;

// Dummy class for backwards-compatibility.

public sealed class FunctionDeclaration : AST
{
        // Constructor.
        internal FunctionDeclaration() : base() {}

#if false
        // Build a function declaration closure.
        public static Closure JScriptFunctionDeclaration
                                (RuntimeTypeHandle handle, String name, String 
method_name,
                                 String[] formal_parameters, JSLocalField[] 
fields,
                                 bool must_save_stack_locals, bool 
hasArgumentsObject,
                                 String text, Object declaringObject, VsaEngine 
engine)
                        {
                                // TODO
                                return null;
                        }
#endif

}; // class FunctionDeclaration

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * FunctionExpression.cs - Function expression nodes.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Collections;

// Dummy class for backwards-compatibility.

public sealed class FunctionExpression : AST
{
        // Constructor.
        internal FunctionExpression() : base() {}

#if false
        // Build a function expression object.
        public static FunctionObject JScriptFunctionExpression
                                (RuntimeTypeHandle handle, String name, String 
method_name,
                                 String[] formal_parameters, JSLocalField[] 
fields,
                                 bool must_save_stack_locals, bool 
hasArgumentsObject,
                                 String text, VsaEngine engine)
                        {
                                // TODO
                                return null;
                        }
#endif

}; // class FunctionExpression

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Globals.cs - Global context for the JScript engine.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

public sealed class Globals
{

        // Current engine context.
        public static VsaEngine contextEngine = null;

        // Construct an array object.  Don't use - not re-entrant safe.
        [JSFunction(JSFunctionAttributeEnum.HasVarArgs)]
        public static ArrayObject ConstructArray(params Object[] args)
                        {
                                return (ArrayObject)
                                        
(ArrayPrototype.constructor.CallConstructor(args));
                        }

        // Construct an array literal.  Don't use - not re-entrant safe.
        public static ArrayObject ConstructArrayLiteral(Object[] args)
                        {
                                return (ArrayObject)
                                        
(ArrayPrototype.constructor.ConstructArray(args));
                        }

        // Get the global context engine.  Use this in preference
        // to directly accessing the "contextEngine" variable.
        internal static VsaEngine GetContextEngine()
                        {
                                // Lock on "VsaEngine" to synchronize with 
"CreateEngine()".
                                lock(typeof(VsaEngine))
                                {
                                        if(contextEngine == null)
                                        {
                                                contextEngine = 
VsaEngine.MakeNewEngine();
                                        }
                                        return contextEngine;
                                }
                        }

        // Set the global context engine.
        internal static void SetContextEngine(VsaEngine engine)
                        {
                                // Lock on "VsaEngine" to synchronize with 
"CreateEngine()".
                                lock(typeof(VsaEngine))
                                {
                                        if(contextEngine == null)
                                        {
                                                contextEngine = engine;
                                        }
                                }
                        }

}; // class Globals

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Import.cs - Import nodes.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

// Dummy class for backwards-compatibility.

public sealed class Import : AST
{
        // Constructor.
        internal Import() : base() {}

        // Import a namespace into an engine instance.
        public static void JScriptImport(String name, VsaEngine engine)
                        {
                                // TODO
                        }

}; // class Import

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * In.cs - Implementation for "in" operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class In : BinaryOp
{
        // Constructor.
        internal In() : base((int)(JSToken.In)) {}

        // Evaluate an "in" operator on two values.
        public static bool JScriptIn(Object v1, Object v2)
                        {
                                // TODO
                                return false;
                        }

}; // class In

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * InstanceOf.cs - Equality operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;

// Dummy class for backwards-compatibility.

public sealed class Instanceof : BinaryOp
{
        // Constructor.
        internal Instanceof() : base((int)(JSToken.Instanceof)) {}

        // Determine if an object is an instance of a class.
        public static bool JScriptInstanceof(Object v1, Object v2)
                        {
                                // TODO
                                return false;
                        }

}; // class Instanceof

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * LateBinding.cs - Handle late binding operations.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

public sealed class LateBinding
{
        // Internal state.
        private String name;
        public Object obj;

        // Constructors.
        public LateBinding(String name)
                        {
                                this.name = name;
                                this.obj = null;
                        }
        public LateBinding(String name, Object obj)
                        {
                                this.name = name;
                                this.obj = obj;
                        }

        // Perform a call on this late binding.
        public Object Call(Object[] arguments, bool construct,
                                           bool brackets, VsaEngine engine)
                        {
                                // TODO
                                return null;
                        }

        // Perform a late binding call.
        public static Object CallValue(Object thisob, Object val,
                                                                   Object[] 
arguments, bool construct,
                                                                   bool 
brackets, VsaEngine engine)
                        {
                                // TODO
                                return null;
                        }

        // Perform a late binding call, with reversed arguments.
        public static Object CallValue2(Object val, Object thisob,
                                                                    Object[] 
arguments, bool construct,
                                                                    bool 
brackets, VsaEngine engine)
                        {
                                // TODO
                                return null;
                        }

        // Delete the named member from the object.
        public bool Delete()
                        {
                                return DeleteMember(obj, name);
                        }
        
        // Delete a named member from a specified object.
        public static bool DeleteMember(Object obj, String name)
                        {
                                // TODO
                                return false;
                        }

        // Get the value of this binding, returning "null" for "Missing".
        public Object GetNonMissingValue()
                        {
                                // TODO
                                return false;
                        }

        // Get the value of this binding, throwing an exception for "Missing".
        public Object GetValue2()
                        {
                                // TODO
                                return false;
                        }

        // Set an indexed property value.
        public static void SetIndexedPropertyValueStatic
                                (Object obj, Object[] arguments, Object value)
                        {
                                // TODO
                        }

        // Set the value of this binding.
        public void SetValue(Object value)
                        {
                                // TODO
                        }

}; // class LateBinding

}; // namespace Microsoft.JScript

--- NEW FILE ---

# The build is done in "runtime", so cd up and use that Makefile.

all:
        (cd ..;make)

clean:
        (cd ..;make clean)

--- NEW FILE ---
/*
 * MemberInfoList.cs - List of "MemberInfo" values.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class MemberInfoList
{
        // Constructor.
        internal MemberInfoList() {}

}; // class MemberInfoList

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * MethodInvoker.cs - Base class for method invokers.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public abstract class MethodInvoker
{
        // Constructor.
        protected MethodInvoker() {}

        // Invoke this method on an object.
        public abstract Object Invoke(Object thisob, Object[] parameters);

}; // class MemberInfoListMethodInvoker

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Namespace.cs - Wrapped up reference to a namespace within an engine.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

public sealed class Namespace
{
        // Internal state.
        internal String name;
        internal VsaEngine engine;

        // Constructor.
        private Namespace(String name, VsaEngine engine)
                        {
                                this.name = name;
                                this.engine = engine;
                        }

        // Get a namespace object.
        public static Namespace GetNamespace(String name, VsaEngine engine)
                        {
                                return new Namespace(name, engine);
                        }

}; // class Namespace

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * NumericBinary.cs - Numeric binary operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class NumericBinary : BinaryOp
{
        // Constructor.
        public NumericBinary(int operatorTok)
                        : base(operatorTok)
                        {
                                // Nothing to do here.
                        }

        // Evaluate a numeric binary operator on two values.
        public Object EvaluateNumericBinary(Object v1, Object v2)
                        {
                                // TODO
                                return null;
                        }

        // Evaluate a numeric binary operator on two values.
        public static Object DoOp(Object v1, Object v2, JSToken operatorTok)
                        {
                                // TODO
                                return null;
                        }

}; // class NumericBinary

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * NumericUnary.cs - Numeric unary operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class NumericUnary : UnaryOp
{
        // Constructor.
        public NumericUnary(int operatorTok)
                        : base(operatorTok)
                        {
                                // Nothing to do here.
                        }

        // Evaluate a numeric unary operator on a value.
        public Object EvaluateUnary(Object v)
                        {
                                // TODO
                                return null;
                        }

}; // class NumericUnary

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Package.cs - Package nodes.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

// Dummy class for backwards-compatibility.

public sealed class Package : AST
{
        // Constructor.
        internal Package() : base() {}

        // Declare a package within an engine instance.
        public static void JScriptPackage(String name, VsaEngine engine)
                        {
                                // TODO
                        }

}; // class Package

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Plus.cs - Numeric plus operator.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class Plus : BinaryOp
{
        // Constructor.
        public Plus() : base((int)(JSToken.Plus)) {}

        // Evaluate a plus operator on two values.
        public Object EvaluatePlus(Object v1, Object v2)
                        {
                                // TODO
                                return null;
                        }

        // Evaluate a plus operator on two values.
        public static Object DoOp(Object v1, Object v2)
                        {
                                // TODO
                                return null;
                        }

}; // class Plus

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * PostOrPrefixOperator.cs - Post or prefix unary operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public class PostOrPrefixOperator : UnaryOp
{
        // Constructor.
        public PostOrPrefixOperator(int operatorTok)
                        : base(operatorTok)
                        {
                                // Nothing to do here.
                        }

        // Evaluate a post or prefix operator on a reference.
        public Object EvaluatePostOrPrefix(ref Object v)
                        {
                                // TODO
                                return null;
                        }

}; // class PostOrPrefixOperator

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * ReferenceAttribute.cs - Mark an assembly with a reference.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

[AttributeUsage(AttributeTargets.Assembly)]
public class ReferenceAttribute : Attribute
{
        // Accessible internal state.
        public String reference;

        // Constructor.
        public ReferenceAttribute(String reference)
                        {
                                this.reference = reference;
                        }

}; // class ReferenceAttribute

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Relational.cs - Relational operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;

// Dummy class for backwards-compatibility.

public class Relational : BinaryOp
{
        // Constructor.
        public Relational(int operatorTok)
                        : base(operatorTok)
                        {
                                // Nothing to do here.
                        }

        // Evaluate a relational operator on two values.
        public double EvaluatRelational(Object v1, Object v2)
                        {
                                // TODO
                                return 0.0;
                        }

        // Compare two values.
        public static double JScriptCompare(Object v1, Object v2)
                        {
                                // TODO
                                return 0.0;
                        }

}; // class Relational

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * ReturnOutOfFinally.cs - Exception to return out of a "finally" block.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

public sealed class ReturnOutOfFinally : ApplicationException
{
        // Constructor.
        public ReturnOutOfFinally() {}

}; // class ReturnOutOfFinally

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * StrictEquality.cs - Strict equality operator.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;

// Dummy class for backwards-compatibility.

public sealed class StrictEquality : BinaryOp
{
        // Constructor.
        internal StrictEquality() : base((int)(JSToken.StrictEqual)) {}

        // Determine if two JScript objects are strictly equal.
        public static bool JScriptStrictEquals(Object v1, Object v2)
                        {
                                // TODO
                                return false;
                        }

}; // class StrictEquality

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Throw.cs - Handle thrown exceptions.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class Throw : AST
{
        // Constructor.
        internal Throw() : base() {}

        // Convert a JScript object into an exception.
        public static Exception JScriptThrow(Object value)
                        {
                                if(value is Exception)
                                {
                                        return (Exception)value;
                                }
                                if(value is ErrorObject)
                                {
                                        Exception e = 
(Exception)(ErrorObject)value;
                                        if(e != null)
                                        {
                                                return e;
                                        }
                                }
                                return new JScriptException(value);
                        }

}; // class Throw

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Try.cs - Exception handler blocks.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

// Dummy class for backwards-compatibility.

public sealed class Try : AST
{
        // Constructor.
        internal Try() : base() {}

        // Construct a JScript exception value.
        public static Object JScriptExceptionValue(Object e, VsaEngine engine)
                        {
                                // TODO
                                return null;
                        }

        // Push the current try handler scope.
        public static void PushHandlerScope
                                (VsaEngine engine, String id, int scopeId)
                        {
                                // TODO
                        }

}; // class Try

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * Typeof.cs - Typeof operator.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;

// Dummy class for backwards-compatibility.

public sealed class Typeof : UnaryOp
{
        // Constructor.
        internal Typeof() : base((int)(JSToken.Typeof)) {}

        // Get the type of a JScript value.
        public static String JScriptTypeof(Object value)
                        {
                                return Support.Typeof(value);
                        }

}; // class Typeof

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * UnaryOp.cs - Common base class for unary operators.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using System.Reflection;

// Dummy class for backwards-compatibility.

public abstract class UnaryOp : AST
{
        // Internal state.
        internal JSToken operatorTok;

        // Constructor.
        internal UnaryOp(int operatorTok)
                        : base()
                        {
                                this.operatorTok = (JSToken)operatorTok;
                        }

}; // class UnaryOp

}; // namespace Microsoft.JScript

--- NEW FILE ---
/*
 * With.cs - Handle "with" blocks.
 *
 * Copyright (C) 2003 Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
namespace Microsoft.JScript
{

using System;
using Microsoft.JScript.Vsa;

// Dummy class for backwards-compatibility.

public sealed class With : AST
{
        // Constructor.
        internal With() : base() {}

        // Push into a "with" scope and return the converted object.
        public static Object JScriptWith(Object withOb, VsaEngine engine)
                        {
                                withOb = Convert.ToObject(withOb, engine);
                                if(withOb != null)
                                {
                                        engine.PushScriptObjectChecked
                                                (new 
WithScope(engine.ScriptObjectStackTop(), withOb));
                                        return withOb;
                                }
                                else
                                {
                                        throw new 
JScriptException(JSError.ObjectExpected);
                                }
                        }

}; // class With

}; // namespace Microsoft.JScript





reply via email to

[Prev in Thread] Current Thread [Next in Thread]