예제 #1
0
	public JArgList(Context context, JNode expr1, JNode expr2)
		: base(context, expr1, expr2)
	{
		this.kind__ = KIND;
	}
예제 #2
0
	// Constructor.
	internal VsaCodeItem(VsaEngine engine, String name, VsaItemFlag flag)
			: base(engine, name, VsaItemType.Code, flag)
			{
				sourceText = null;
				parsed = null;
			}
예제 #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);
			}
예제 #4
0
	public JFieldAccess(Context context, JNode expr, String name)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
		this.name = name;
	}
예제 #5
0
	// Reset the compiled state of this item.
	internal override void Reset()
			{
				parsed = null;
			}
예제 #6
0
	protected JBinaryExpression(Context context, JNode expr1, JNode expr2)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr1 = expr1;
		this.expr2 = expr2;
	}
예제 #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;
	}
예제 #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;
	}
예제 #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;
	}
예제 #10
0
	public JDo(Context context, JNode body, JNode condition)
		: base(context)
	{
		this.kind__ = KIND;
		this.body = body;
		this.condition = condition;
	}
예제 #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;
	}
예제 #12
0
	public JWhile(Context context, JNode condition, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.condition = condition;
		this.body = body;
	}
예제 #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;
	}
예제 #14
0
	public JExprStmt(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
예제 #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;
	}
예제 #16
0
	public JSwitch(Context context, JNode expr, JNode cases)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
		this.cases = cases;
	}
예제 #17
0
	protected JUnaryExpression(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
예제 #18
0
	public JDefault(Context context, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.body = body;
	}
예제 #19
0
	public JAssign(Context context, JNode expr1, JNode expr2)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr1 = expr1;
		this.expr2 = expr2;
	}
예제 #20
0
	public JFallThrough(Context context, JNode stmt)
		: base(context)
	{
		this.kind__ = KIND;
		this.stmt = stmt;
	}
예제 #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;
	}
예제 #22
0
	public JReturnExpr(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
예제 #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;
	}
예제 #24
0
	public JThrow(Context context, JNode expr)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
	}
예제 #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;
			}
예제 #26
0
	public JWith(Context context, JNode expr, JNode body)
		: base(context)
	{
		this.kind__ = KIND;
		this.expr = expr;
		this.body = body;
	}
예제 #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));
				}
			}
예제 #28
0
	public JVarDecl(Context context, String name, JNode initializer)
		: base(context)
	{
		this.kind__ = KIND;
		this.name = name;
		this.initializer = initializer;
	}
예제 #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");
				}
			}
예제 #30
0
	public JCall(Context context, JNode expr1, JNode expr2)
		: base(context, expr1, expr2)
	{
		this.kind__ = KIND;
	}