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.8. Additional Features of Logikus

At this point, we have covered the fundamentals of logic programming. If you understand structures, variables, facts, and rules, you can create logic programs to model logical problems in the real world. In practice, several other features enhance this modeling, including

  • Comments

  • Evaluations

  • Negation

  • Anonymous variables

  • Lists

13.8.1. Comments

The Logikus parser that comes with this book accepts comments in the same format that Java does. A comment that begins with // extends to the end of the line on which it appears. For example, the line

founded(rome, bc750); // according to legend... 

provides a comment on the stated fact.

A comment that begins with /* comments out all text until the next */. If there is ...

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