예제 #1
0
		public override PerCederberg.Grammatica.Runtime.Node ExitInExpression(PerCederberg.Grammatica.Runtime.Production node)
		{
			var childValues = this.GetChildValues(node);

			if (childValues.Count == 1) {
				this.AddFirstChildValue(node);
				return node;
			}

            var operand = (ExpressionElement)childValues[0];
			childValues.RemoveAt(0);

			object second = childValues[0];
			InElement op = null;

			if ((second) is IList) {
				op = new InElement(operand, (IList)second);
			} else {
				var il = new InvocationListElement(childValues, MyServices);
				op = new InElement(operand, il);
			}

			node.AddValue(op);
			return node;
		}
예제 #2
0
		public override PerCederberg.Grammatica.Runtime.Node ExitMemberExpression(PerCederberg.Grammatica.Runtime.Production node)
		{
			var childValues = this.GetChildValues(node);
			object first = childValues[0];

			if (childValues.Count == 1 && !(first is MemberElement)) {
				node.AddValue(first);
			} else {
				var list = new InvocationListElement(childValues, MyServices);
				node.AddValue(list);
			}

			return node;
		}