12.2 The Role of Engines


 
Building Parsers with Java
By Steven  John  Metsker

Table of Contents
Chapter  12.   Engines

    Content

Some languages rely on an engine to perform a useful service. In particular, logic languages and query languages need an engine in order to work. For example, Prolog is a leading logic programming language that needs an engine to prove its logical statements. SQL, or Structured Query Language, is a popular query language that also uses an engine to do the work that a query requests . A parser can parse a statement such as:

 "select status from sales where city = 'Istanbul'" 

However, a parser needs an engine to actually find the results. The engine is the part of the software in a database that decides which records fulfill the demands of a query.

Writing code to directly access an engine is usually complicated. It is safe to say that most people who use SQL never dream of accessing the engine directly from a programming language. In fact, many SQL users are unaware that the engine exists. If your only interaction with a database is through its query language, it might not occur to you to ponder the mechanics that allow the query language to function. A more realistic view of a database is that the database is the engine, and the engine comes with a language that provides a simple interface to the engine.

Engines and parsers are natural partners . Parsers provide a simple interface to an engine. The engine powers the language. This chapter introduces a logic engine used in the next three chapters. Chapter 13 introduces logic programming, giving examples in the Logikus programming language. Chapter 14 shows how to create a parser for Logikus. Chapter 15 shows how to create a query language using the engine from this chapter in place of a commercial database engine.


   
Top


Building Parsers with Java
Building Parsers With Javaв„ў
ISBN: 0201719622
EAN: 2147483647
Year: 2000
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net