/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(PredicatePEffectAstNode astNode) { PredicateEffect predicate = new PredicateEffect(astNode.Name); astNode.Terms.ForEach(term => predicate.Terms.Add(MasterExporter.ToTerm(term))); EffectsData.Add(predicate); }
/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(PredicateGdAstNode astNode) { PredicateExpression predicate = new PredicateExpression(astNode.Name); astNode.Terms.ForEach(term => predicate.Terms.Add(MasterExporter.ToTerm(term))); ExpressionData = predicate; }
/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(FunctionTermAstNode astNode) { NumericFunction function = new NumericFunction(astNode.Name); astNode.Terms.ForEach(term => function.Terms.Add(MasterExporter.ToTerm(term))); ExpressionData = function; }
/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(FunctionTermAstNode astNode) { ObjectFunctionTerm functionTerm = new ObjectFunctionTerm(astNode.Name); astNode.Terms.ForEach(argTerm => functionTerm.Terms.Add(MasterExporter.ToTerm(argTerm))); TermData = functionTerm; }
/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(AssignPEffectAstNode astNode) { if (astNode.AssignOperator == Traits.AssignOperator.ASSIGN && MasterExporter.IsTerm(astNode.Argument2)) { EffectsData.Add(new ObjectAssignEffect((ObjectFunctionTerm)MasterExporter.ToTerm(astNode.Argument1), MasterExporter.ToTerm(astNode.Argument2))); } else { EffectsData.Add(new NumericAssignEffect(astNode.AssignOperator, (NumericFunction)MasterExporter.ToNumericExpression(astNode.Argument1), MasterExporter.ToNumericExpression(astNode.Argument2))); } }
/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(EqualsOpGdAstNode astNode) { if (MasterExporter.IsNumericExpression(astNode.Argument1) && MasterExporter.IsNumericExpression(astNode.Argument2)) { ExpressionData = new NumericCompareExpression(Traits.NumericComparer.EQ, MasterExporter.ToNumericExpression(astNode.Argument1), MasterExporter.ToNumericExpression(astNode.Argument2)); } else { ExpressionData = new EqualsExpression(MasterExporter.ToTerm(astNode.Argument1), MasterExporter.ToTerm(astNode.Argument2)); } }
/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(EqualsOpPEffectAstNode astNode) { EffectsData.Add(new EqualsEffect(MasterExporter.ToTerm(astNode.Term1), MasterExporter.ToTerm(astNode.Term2))); }