Related articles |
---|
parser generator terminology rpboland@gmail.com (Ralph Boland) (2009-09-06) |
Re: parser generator terminology mhelvens@gmail.com (Michiel) (2009-09-06) |
Re: parser generator terminology DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-09-06) |
Re: parser generator terminology cfc@shell01.TheWorld.com (Chris F Clark) (2009-09-06) |
Re: parser generator terminology cfc@shell01.TheWorld.com (Chris F Clark) (2009-09-07) |
Re: parser generator terminology haberg_20080406@math.su.se (Hans Aberg) (2009-09-07) |
Re: parser generator terminology mhelvens@gmail.com (Michiel) (2009-09-07) |
[5 later articles] |
From: | Ralph Boland <rpboland@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Sun, 6 Sep 2009 09:56:13 -0700 (PDT) |
Organization: | Compilers Central |
Keywords: | parse, question |
Posted-Date: | 06 Sep 2009 14:13:48 EDT |
I am designing my own parser generator tool (please don't advise me on
the wisdom of creating yet another parser generator tool) and am
trying to sort out the terminology so that I can name my classes,
methods and variables (identifiers).
Some things are clear. The specification of the syntax of a language
is a grammar. The grammar consists of a set of productions or rules.
Each production has a name and a right hand side consisting of
terminals and nonterminals. Based on the grammar a parser is built
for constructing a parse tree from a given input program (sentence).
In addition a sentence in a language consists of a set of words. The
parser uses a scanner to decompose an input program into its words.
Words are classified into types called lexemes instances of which are
called tokens. The tokens correspond to the nonterminals of the
grammar.
From here things are less clear to me.
1) Is there a name for the definition of the set of tokens; preferably
a short name useful for naming identifiers? (I do not like regular
definition since it implies a set of rules I do not follow.)
2) Most parser generator tools actually use attribute grammars, which
have attributes or semantic actions, and build abstract syntax trees.
In my system the grammar is not attributed and instead a separate
table is used to define the attributes and semantic actions associated
with the grammar rules. I need a name for this table but don't know
what to call it. Possibilities are attribute table, transformation
table, and abstract syntax table. I don't like these though because
they lead to long identifier names. I am considering using tree morph
table, or just morph table. Individual entries in the morph table
would be called morphs. This works well for naming identifiers but
will be cryptic for anybody else but me. Can anybody make a better
suggestion than those I mentioned?
3) Most parser generator tools build parsers that call the scanner to
get tokens. In my system the parser calls a token fetcher that used
one or more scanners to get tokens and may then process its input
before returning its versions of tokens back to the parser. I do not
have a good name for the token fetcher. One possibility is to call
the scanner the lexer and the token fetcher the scanner. Can anybody
suggest a name for my token fetcher?
4) Some systems have specifications for defining methods for walking
over abstract syntax trees and making further transformations or
constructions. I am not planning to do this but am curious to know a
good name for such a specification preferably suitable for identifier
naming.
All suggestions much appreciated.
Ralph Boland
Return to the
comp.compilers page.
Search the
comp.compilers archives again.