Crate gdl_parser[stability] [-] [+] [src]

This crate provides a function for parsing a GDL description to an AST. To get an AST, call the parse function with the string representing the description. The AST is based off the AST used in GGP Base.

Modules

visitor

Structs

Constant

A GDL constant

Description

A GDL description. Contains a vector of Clauses, which are the top-level statements in a GDL description.

Distinct

A distinct literal

Function

A function term

Not

A not literal

Or

An or literal

Proposition

A proposition is a Relation with no body; it only has a name.

Relation

A GDL relation

Rule

A GDL rule contains a head Sentence that is implied by all the Literals in the body

Variable

A variable term

Enums

Clause

A top level statement in GDL. The only types of top level statements are Rules and Sentences

Literal

A GDL literal

Sentence

A GDL sentence is like a Rule without a body. The two types of Sentences are Relations and Propositions

Term

A GDL term is either a variable, a function, or a constant

Functions

parse

Parse a GDL string to a Description. Panics if the description is invalid.