[Q] Basic Terminology Questions

"Michael Peterson" <mtp1032@home.com>
5 Jan 2001 14:06:44 -0500

          From comp.compilers

Related articles
[Q] Basic Terminology Questions mtp1032@home.com (Michael Peterson) (2001-01-05)
Re: [Q] Basic Terminology Questions tenkey@my-deja.com (2001-01-06)
Re: [Q] Basic Terminology Questions rkrayhawk@aol.com (2001-01-09)
| List of all articles for this month |

From: "Michael Peterson" <mtp1032@home.com>
Newsgroups: comp.compilers,comp.compilers.tools.javacc
Date: 5 Jan 2001 14:06:44 -0500
Organization: Excite@Home - The Leader in Broadband http://home.com/faster
Keywords: question, comment
Posted-Date: 05 Jan 2001 14:06:44 EST
X-Mimeole: Produced By Microsoft MimeOLE V5.00.3018.1300

In order to get started on compiler design and implementation, I've been
reading various sources (including the FAQs for this newsgroup) and WEB
references. I keep running across a small set of terms that, evidently
everyone knows except me. [:-)


For example, in the JavaCC distribution there is a very simple grammar
called Simple1. In the description of this grammar (and the others, also),
the words "terminals" and "non-terminals" are used to name what, to my naive
eye, look like, well, simple rules.


Here's a couple of examples, both from the Simple1.jj file.


IGNORE_IN_BNF: {}
{
        " " | "\r" | "\t"
}


Why is the name, "IGNORE_IN_BNF", called a 'terminal'? Isn't this just a
rule to ignore white space characters?


Here's an example of a non-terminal:


void Input() : {}
{
        MatchedBraces() ("\n" | "\r")* <EOF>
}


In this fragment, the name "MatchedBraces()" is called a non-terminal.


Clearly, the terms terminal and non-terminal are meant to convey meaning.
Can someone tell me what both of these terms mean?


Thanks in advance


Cheers


Michael
[A terminal is a symbol that comes directly from the input, a nonterminal
is a symbol that is built up from zero or more other symbols. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.