Exemplo n.º 1
0
	public JArgList(Context context, JNode expr1, JNode expr2)
		: base(context, expr1, expr2)
	{
		this.kind__ = KIND;
	}
Exemplo n.º 2
0
	// Constructor.
	internal VsaCodeItem(VsaEngine engine, String name, VsaItemFlag flag)
			: base(engine, name, VsaItemType.Code, flag)
			{
				sourceText = null;
				parsed = null;
			}
Exemplo n.º 3
0
	// Determine if a node corresponds to a builtin function reference.
	private bool IsBuiltinCall(JNode node, String name)
			{
				return (node is JIdentifier &&
						((JIdentifier)node).name == name);
			}
Exemplo n.º 4
0
	public JFieldAccess(Context context, JNode expr, String name)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
		this.name = name;
	}
Exemplo n.º 5
0
	// Reset the compiled state of this item.
	internal override void Reset()
			{
				parsed = null;
			}
Exemplo n.º 6
0
	protected JBinaryExpression(Context context, JNode expr1, JNode expr2)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr1 = expr1;
		this.expr2 = expr2;
	}
Exemplo n.º 7
0
	public JAssignOp(Context context, JSToken oper, JNode expr1, JNode expr2)
		: base(context)
	{
		this.kind__ = KIND;
		this.oper = oper;
		this.expr1 = expr1;
		this.expr2 = expr2;
	}
Exemplo n.º 8
0
	public JFor(Context context, JNode init, JNode cond, JNode incr, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.init = init;
		this.cond = cond;
		this.incr = incr;
		this.body = body;
	}
Exemplo n.º 9
0
	public JForIn(Context context, JNode decl, JNode expr, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.decl = decl;
		this.expr = expr;
		this.body = body;
	}
Exemplo n.º 10
0
	public JDo(Context context, JNode body, JNode condition)
		: base(context)
	{
		this.kind__ = KIND;
		this.body = body;
		this.condition = condition;
	}
Exemplo n.º 11
0
	public JExprListElem(Context context, Object name, JNode expr, JExprListElem next)
		: base(context)
	{
		this.kind__ = KIND;
		this.name = name;
		this.expr = expr;
		this.next = next;
	}
Exemplo n.º 12
0
	public JWhile(Context context, JNode condition, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.condition = condition;
		this.body = body;
	}
Exemplo n.º 13
0
	public JIf(Context context, JNode condition, JNode thenClause, JNode elseClause)
		: base(context)
	{
		this.kind__ = KIND;
		this.condition = condition;
		this.thenClause = thenClause;
		this.elseClause = elseClause;
	}
Exemplo n.º 14
0
	public JExprStmt(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
Exemplo n.º 15
0
	public JTry(Context context, JNode body, String catchName, JNode catchClause, JNode finallyClause)
		: base(context)
	{
		this.kind__ = KIND;
		this.body = body;
		this.catchName = catchName;
		this.catchClause = catchClause;
		this.finallyClause = finallyClause;
	}
Exemplo n.º 16
0
	public JSwitch(Context context, JNode expr, JNode cases)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
		this.cases = cases;
	}
Exemplo n.º 17
0
	protected JUnaryExpression(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
Exemplo n.º 18
0
	public JDefault(Context context, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.body = body;
	}
Exemplo n.º 19
0
	public JAssign(Context context, JNode expr1, JNode expr2)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr1 = expr1;
		this.expr2 = expr2;
	}
Exemplo n.º 20
0
	public JFallThrough(Context context, JNode stmt)
		: base(context)
	{
		this.kind__ = KIND;
		this.stmt = stmt;
	}
Exemplo n.º 21
0
	public JIfExpr(Context context, JNode expr1, JNode expr2, JNode expr3)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr1 = expr1;
		this.expr2 = expr2;
		this.expr3 = expr3;
	}
Exemplo n.º 22
0
	public JReturnExpr(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
Exemplo n.º 23
0
	public JFunction(Context context, String name, JFormalParams fparams, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.name = name;
		this.fparams = fparams;
		this.body = body;
	}
Exemplo n.º 24
0
	public JThrow(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
Exemplo n.º 25
0
	// Compile this item.
	internal override bool Compile()
			{
				if(parsed == null && sourceText != null)
				{
					Context context = new Context(sourceText);
					context.codebase = new CodeBase(codebaseOption, this);
					context.codebase.site = engine.Site;
					JSParser parser = new JSParser(context);
					parser.printSupported = engine.printSupported;
					try
					{
						parsed = parser.ParseSource(false);
					}
					catch(JScriptException e)
					{
#if !CONFIG_SMALL_CONSOLE
						ScriptStream.Error.WriteLine(e.Message);
#else
						ScriptStream.WriteLine(e.Message);
#endif
						return false;
					}
					if(parser.numErrors > 0)
					{
						// There were errors that were partially recovered.
						parsed = null;
						return false;
					}
				}
				return true;
			}
Exemplo n.º 26
0
	public JWith(Context context, JNode expr, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
		this.body = body;
	}
Exemplo n.º 27
0
	// Update a case node with fall-through information.
	private void UpdateFallThrough(JNode caseStmt, JNode stmt)
			{
				if(caseStmt is JCase)
				{
					((JCase)caseStmt).body =
						Support.CreateCompound
							(((JCase)caseStmt).body,
							 new JFallThrough(tokenInfo.MakeCopy(), stmt));
				}
				else if(caseStmt is JDefault)
				{
					((JDefault)caseStmt).body =
						Support.CreateCompound
							(((JDefault)caseStmt).body,
							 new JFallThrough(tokenInfo.MakeCopy(), stmt));
				}
			}
Exemplo n.º 28
0
	public JVarDecl(Context context, String name, JNode initializer)
		: base(context)
	{
		this.kind__ = KIND;
		this.name = name;
		this.initializer = initializer;
	}
Exemplo n.º 29
0
	// Determine if a node is a left-hand side expression.
	private void CheckLeftHandSideExpression(JNode node)
			{
				if(!(node is JConstant) &&
				   !(node is JArrayLiteral) &&
				   !(node is JThis) &&
				   !(node is JSuper) &&
				   !(node is JIdentifier) &&
				   !(node is JNew) &&
				   !(node is JArrayAccess) &&
				   !(node is JFieldAccess) &&
				   !(node is JCall))
				{
					SyntaxError(node.context, "invalid l-value");
				}
			}
Exemplo n.º 30
0
	public JCall(Context context, JNode expr1, JNode expr2)
		: base(context, expr1, expr2)
	{
		this.kind__ = KIND;
	}