Exemplo n.º 1
0
 public Block(ExposableParseTreeNode tree, ArrayList parameters, IScope containingScope)
 {
     ParseTree = tree;
     if (parameters == null)
         _Parameters = new ArrayList();
     else
         _Parameters = parameters;
     _ContainingScope = containingScope;
 }
Exemplo n.º 2
0
		/// <summary>
		/// Parse
		/// </summary>
		/// <returns>true if success, false if failure</returns>
		public bool Parse()
		{
			ParseTree = null;
			BehaviorParser parser = new BehaviorParser(_ContextString);
			string error = null;
			try
			{
				ParseTree = parser.Parse(Input);
			}
			catch (ExpectedTokenParseException e)
			{
				error = e.Message;
			}
			catch (UnexpectedTokenParseException e)
			{
				error = e.Message;
			}
			if (error != null)
			{
				State = InterpreterState.ParseFailure;
				ErrorString = error;
				return false;
			}
			State = InterpreterState.ParseSuccess;
			return true;
		}