Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Limiting Keyword Use with Backus/Naur Form Extensions

IP.com Disclosure Number: IPCOM000118733D
Original Publication Date: 1997-Jun-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 2 page(s) / 60K

Publishing Venue

IBM

Related People

Brisson, JP: AUTHOR

Abstract

Disclosed is an extension to Backus/Naur Form (BNF) notation that enables limiting keyword use to no more than once in a given context. Use of the extension with required and optional keywords, use with a parser generator, and error message are described.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Limiting Keyword Use with Backus/Naur Form Extensions

      Disclosed is an extension to Backus/Naur Form (BNF) notation
that enables limiting keyword use to no more than once in a given
context.  Use of the extension with required and optional keywords,
use with a parser generator, and error message are described.

      A symbol (for attached examples a single quote) is used in BNF
notation to signify that a particular terminal symbol can appear only
once.  A parser generator user is thereby allowed to specify in the
parser generator source (BNF) which keywords may be used only once.
The generated code then handles checking to be sure that it is only
used once in the appropriate context.  This can be implemented by
flags associated with the keywords and other such techniques.

      The scope within which a keyword can appear only once can be
controlled as well.  For example, it may be important to allow a
keyword to be specified only once for a given statement, e.g., an
attribute on a  declare statement, but it may appear on multiple
statements.  This is enabled by allowing the keyword to be 'reset' at
any point in the parser  generator source.  In the following
examples, the symbol to be reset is  bracketed by exclamation points
to signify that the symbol is 'reset'.

      The parser generator wherein this feature is applied provides
generated error message handling.  The syntax error messages are,
therefore, free to users.  Therefore, making the multiple keyword
specification a syntax error provides value two ways:
  1.  There is no need to write code to check for multiple
       specification of keywords.
  2.  Multiple specification is a syntax error.  Since syntax
       error messages are handled by generated code, there is
       no need to write code to issue a message when the problem
       is detected.

      Examples

      In the following examples, a non-terminal symbol (in angle <>
brackets) appearing on the right side of an equals sign can be
replaced by whatever it is equal t...