O'Reilly logo

Building Parsers with Java™ by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.2. Building Blocks

The fundamental elements of Logikus are structures and variables. As a logic programmer, you will learn to weave structures and variables together into rules and then to combine rules to form logic programs.

13.2.1. Structures

A structure is the basic data repository in a logic language. A structure is a functor associated with a group of terms. A functor can be a lowercase string, a quoted string, or a number. Some acceptable functors are

jamesCagney 

starred

"Yankee Doodle Dandy"

1942

In addition to having a functor, each structure possesses a collection of zero or more terms. A structure with no terms is an atom. When a structure has terms, they must be structures and variables, separated by commas and enclosed in parentheses. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required