Home Products Products Services Links Guestbook About the Author
 
 
 
 
 
 
 

Home
  News

Products
  Components
  Download

Services
  Programming
  Web Design

Links

Guestbook
  View
  Sign

About me


TParserAll


This non-visual component is designed especially for programmers that need parsing power without having to understand parsing theory or deal with code generators.
It requires a Backus-Naur Form grammar to work. Since you can define a grammar for all situations, TParserAll can parse all you can imagine.
The grammar is a TStrings object accessible at run-time and design-time through the BNF property. In design-time, the grammar is supported by a powerfull property editor with color syntax highlighting and real time grammar validation. Also allows the programmer to test the grammar and to debug it, in order to find out why a specific non-terminal did or did not recognized the data.

BNF Grammar Property Editor - Definition BNF Grammar Property Editor - Debug
Grammar Definition
Debug
Test
Backus-Naur Form Grammars

Syntactically, a BNF grammar defines a set of productions (or rules) consisting of a non-terminal followed by the symbol ::= and a combination of terminals and non-terminals.  A terminal is an atomic token, like a digit, and a non-terminal is a high level symbol that ultimately expands into a series of tokens, such as a mathematical expression.  All non-terminals are delimited by '<' and '>'.  For example, here is one grammar that might be used by TParserAll for automatic recognition of a person's last name, first name and middle initial:

; This grammar automatically recognizes a person's first, last and middle name
; <Person's Name> can assume the form of

<Person's Name> ::=
       <s*><last name><s*>,<s*><first name><s+><middle initial><s*>|
       <s*><last name><s*>,<s*><first name><s*>|
       <s*><first name><s+><middle initial><s+><last name><s*>|
       <s*><first name><s+><last name><s*>|
       <s*><first name><s*>

<first name> ::= <name>
<last name> ::= <name>
<middle initial> ::= <char>

<char> ::= a..z

; <name> is a string of characters
<name> ::= <char><name>|<char>

; <s+> is a sequence of one or more blank spaces and tabs
<s+> ::= ' '<s+>|<tab><s+>|' '|<tab>
<tab> ::= $09

; <s*> is a sequence of zero or more blank spaces and tabs
<s*> ::= ' '<s*>|<tab><s*>|''

; Last, First MI
; Last, First
; First MI Last
; First Last
; First



The above grammar is able to recognize the parts of a name from, for example:
Lewis, Jay
Lewis, Jay R
Jay R Lewis
Jay Lewis
Jay
or even with no spaces or extra spaces between,
Lewis,Jay   R

This grammar is available in the downloaded Demo.
More information regarding BNF grammars is available in the component help.


Technology

TParserAll is an efficient, general-purpose, top-down parsing engine with pratically unlimited backtracking capability, that uses a LL(1) grammar. It is a top-down parser, so it doesn't support immediate left recursions. Instead, TParserAll can find and warn you of both immediate and hidden left recursions in your grammar so that they can be easly changed.


Most Important Features

• Grammar defined by the user - For a new parsing task, the engine doesn't change, you just load a new grammar;
• Powerfull property editor for the grammar definition, grammar testing and debugging;
• Grammar syntax highlighting;
• Extensive and fast grammar validation;
• Methods for data streams also available for file streams;
• Simplicity of use;
• On-line help.


Previous page

 Web hosting by WebStrikeSolutions

Home • Products • ServicesLinksGuestbookAbout Me