Axiom.Compiler.Framework.PrologCodeGenerator.CompileClauseHead C# (CSharp) Метод

CompileClauseHead() приватный Метод

private CompileClauseHead ( PrologCodeTerm head, ArrayList instructions ) : void
head Axiom.Compiler.CodeObjectModel.PrologCodeTerm
instructions System.Collections.ArrayList
Результат void
        private void CompileClauseHead(PrologCodeTerm head, ArrayList instructions)
        {
            if (head is PrologCodePredicate)
            {
                PrologCodePredicate headPredicate = (PrologCodePredicate)head;

                if (headPredicate.Arity == 0)
                {
                    /* Do nothing */
                }
                else
                {
                    CompileHeadArguments(((PrologCodePredicate)head).Arguments);
                }
            }
            else if (head is PrologCodeNonEmptyList)
            {
                ArrayList headListArguments = new ArrayList();
                PrologCodeNonEmptyList NEList = (PrologCodeNonEmptyList)head;
                headListArguments.Add(NEList.Head);
                headListArguments.Add(NEList.Tail);
                CompileHeadArguments(headListArguments);
            }
            else if (head is PrologCodeVariable)
            {
                throw new PrologCompilerException("Clause head cannot be a variable.");
            }
            else if (head is PrologCodeIntegerAtom || head is PrologCodeFloatAtom)
            {
                throw new PrologCompilerException("Clause head cannot be a number.");
            }
        }