[antlr-interest] "An Introduction to ANTLR" presentation slides

Micheal J open.zone at virgin.net
Tue Mar 4 11:32:07 PST 2008


Hi,
 
> The point of terminology is to help convey ideas. It doesn't 
> matter that no terminology is perfect. It does matter that 
> some terminologies are better at getting the point across. 
> I'm not arguing about something
> abstract and theoretical, I'm arguing that the "syntactic predicate" 
> terminology could be better.
> "Better" not meaning "more valid", of course, but meaning 
> "better at conveying to ANTLR users what it's used for".

Following on from my previous post:

Syntactic predicates: 
  - Used to check the syntax independent of context.
  OR
  - Used to check the "form of the input" independent of context.
  OR
  - Used to check the "word- and phrase-level structure of the input"
independent of context.
  OR
  - Used to check the "word-level and phrase-level structure of the input
(be it a character stream or a word/token stream)" independent of context.

Semantic predicates: Used to check/resolve context-depenendent ambiguities.

The precise mechanism used to implement either isn't particularly
interesting from the PoV of trying to understand what they are used for.

> I DO object to you saying "syntax==structure" and then 
> starting to say "structure" instead of syntax.
> Yes, that's perfectly valid in theory. In practice, though, 
> it's obscuring things, as we're discussing the term "syntax" itself.

In our domain, "syntax" is concerned with [rules that define] the structure
of valid strings (words and phrases) in a language over some alphabet. Using
syntax and structure interchangably isn't particularly odious.

> I know that no terminology is perfect, so why do people keep 
> going down this deep rabbit hole of what exactly "syntax" means?
> In the end, it doesn't matter that it actually, deep down, 
> means "the form of ANY input".
> What matters is that people who use ANTLR typically use 
> "syntax" to mean "form OF THE (initial) INPUT".
> (At least the people who write software rather than 
> participate in these abstract debates).

Agreed. Structure of the input. As defined by our language and it's
alphabet. As fed to our recognizers - lexers, parsers and treeparsers.

We don't typically (at least most here don't seem to) restrict our use of
the word "syntax" to describe just lexer (or parser) input. As mentioned
previously, the [expanded form of the] name for TreeParser input (AST) has
the word "syntax" in it. 


Micheal



More information about the antlr-interest mailing list