Class ARelation
java.lang.Object
edu.unc.cs.comp524.parsers.prolog.ARelation
- All Implemented Interfaces:
Relation
public abstract class ARelation extends Object implements Relation
Abstract super-class that handles most of the
Relation details.-
Constructor Summary
Constructors Constructor Description ARelation(PrologParser.AtomContext atom, PrologParser.TermlistContext termlist, Optional<Comment> comment)Constructor for use withPrologParser-related objects.ARelation(String name, List<org.antlr.v4.runtime.tree.ParseTree> args, Optional<Comment> comment) -
Method Summary
Modifier and Type Method Description List<org.antlr.v4.runtime.tree.ParseTree>args()The arguments of the relationintarity()How many arguments the relation takesOptional<Comment>comment()TheComment, if availableStringname()The name of the relationStringtoString()A JSON-like debugging-aidStringrepresentation.
-
Constructor Details
-
ARelation
public ARelation(PrologParser.AtomContext atom, PrologParser.TermlistContext termlist, Optional<Comment> comment)Constructor for use withPrologParser-related objects.- Parameters:
atom- Context from which to derivenametermlist- Context from which to deriveargs
-
ARelation
-
-
Method Details
-
name
Description copied from interface:RelationThe name of the relation -
args
Description copied from interface:RelationThe arguments of the relation -
arity
public int arity()Description copied from interface:RelationHow many arguments the relation takesShould be equivalent to
args().size() -
comment
Description copied from interface:RelationTheComment, if available -
toString
A JSON-like debugging-aidStringrepresentation.
-