Methods and system for converting a text-based grammar to a compressed syntax diagram
First Claim
1. A method for converting a text-based grammar to a compressed syntax diagram using a programmed computer having a memory and an output means, said text-based grammar having a plurality of grammar rules therein and having at least one non-terminal symbol defined by a grammar rule of said plurality of grammar rules, said compressed syntax diagram having a syntax fragment, said method comprising the steps of:
- (a) determining for a selected grammar rule of the plurality of grammar rules within said text-based grammar, a space required within said syntax fragment of said compressed syntax diagram for said selected grammar rule;
(b) accumulating a total space required within said syntax fragment by adding thereto said space required from said step (a), and storing said total space required in said memory of said programmed computer;
(c) if said selected grammar rule of said step (a) includes a non-terminal symbol, using as said selected grammar rule a grammar rule within said text-based grammar which defines said non-terminal symbol and repeating said steps (a), (b) and (c), said repeating being performed provided said total space required does not exceed a predetermined space available on said output means for said syntax fragment of said compressed syntax diagram, said predetermined space being sufficient for at least two grammar rules of said plurality of grammar rules to be accommodated within said syntax fragment of said compressed syntax diagram; and
(d) establishing said compressed syntax diagram based upon each selected grammar rule of said step (a), wherein said syntax fragment of said compressed syntax diagram contains data representative of multiple grammar rules of said plurality of grammar rules.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods and a system for converting a BNF grammar to a compressed railroad diagram are set forth. For a selected grammar rule within the text-based grammar, a space required within the compressed railroad diagram is determined. Thereafter, a space required is added to a total space required for the compressed railroad diagram. If the selected grammar rule includes a non-terminal symbol, then a grammar rule within the text-based grammar which defines the non-terminal symbol is used as the selected grammar rule, and the method is repeated provided that the total space required does not exceed a predetermined space available for the compressed railroad diagram. The compressed railroad diagram is generated based upon each selected grammar rule.
49 Citations
18 Claims
-
1. A method for converting a text-based grammar to a compressed syntax diagram using a programmed computer having a memory and an output means, said text-based grammar having a plurality of grammar rules therein and having at least one non-terminal symbol defined by a grammar rule of said plurality of grammar rules, said compressed syntax diagram having a syntax fragment, said method comprising the steps of:
-
(a) determining for a selected grammar rule of the plurality of grammar rules within said text-based grammar, a space required within said syntax fragment of said compressed syntax diagram for said selected grammar rule; (b) accumulating a total space required within said syntax fragment by adding thereto said space required from said step (a), and storing said total space required in said memory of said programmed computer; (c) if said selected grammar rule of said step (a) includes a non-terminal symbol, using as said selected grammar rule a grammar rule within said text-based grammar which defines said non-terminal symbol and repeating said steps (a), (b) and (c), said repeating being performed provided said total space required does not exceed a predetermined space available on said output means for said syntax fragment of said compressed syntax diagram, said predetermined space being sufficient for at least two grammar rules of said plurality of grammar rules to be accommodated within said syntax fragment of said compressed syntax diagram; and (d) establishing said compressed syntax diagram based upon each selected grammar rule of said step (a), wherein said syntax fragment of said compressed syntax diagram contains data representative of multiple grammar rules of said plurality of grammar rules. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A system for producing a compressed syntax diagram from a text-based grammar input, said text-based grammar input comprising a first plurality of grammar rules, said compressed syntax diagram comprising a computer generated output, said system comprising:
-
a programmed computer having an output means; and means for determining, using said programmed computer, a second plurality of grammar rules comprising at least a subset of said first plurality of grammar rules, said second plurality of grammar rules defining a syntax diagram fragment, said syntax diagram fragment having a size no greater than a predetermined size within said computer generated output, wherein multiple grammar rules of said first plurality of grammar rules are accommodated within said syntax diagram fragment. - View Dependent Claims (18)
-
Specification