Re: terminological problem (EBNF & regular expressions)

Detlef Meyer-Eltz <Meyer-Eltz@t-online.de>
15 Oct 2005 12:59:55 -0400

          From comp.compilers

Related articles
terminological problem Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2005-10-13)
Re: terminological problem (EBNF & regular expressions) paul@parsetec.com (Paul Mann) (2005-10-14)
Re: terminological problem (EBNF & regular expressions) Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2005-10-15)
Re: terminological problem (EBNF & regular expressions) paul@parsetec.com (Paul Mann) (2005-10-17)
Re: terminological problem (EBNF & regular expressions) paul@parsetec.com (Paul Mann) (2005-10-19)
Re: terminological problem (EBNF & regular expressions) Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2005-10-19)
Re: terminological problem (EBNF & regular expressions) paul@parsetec.com (Paul Mann) (2005-10-20)
Re: terminological problem (EBNF & regular expressions) Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2005-10-23)
Re: terminological problem (EBNF & regular expressions) paul@parsetec.com (Paul Mann) (2005-10-26)
[1 later articles]
| List of all articles for this month |
From: Detlef Meyer-Eltz <Meyer-Eltz@t-online.de>
Newsgroups: comp.compilers
Date: 15 Oct 2005 12:59:55 -0400
Organization: Compilers Central
References: 05-10-082 05-10-093
Keywords: parse
Posted-Date: 15 Oct 2005 12:59:55 EDT

Because of my terminologic problem I could not explain my terminologic
problem. Nevertheless your answer is interesting for me.


First I try to explain my problem again: I think it is a widespread
opinion, that regular expressions are written with a notation using
'?', '*' and '+', as this notation is used in many text processing
software. I am looking for a word for this kind of regular
expressions. I want to contrast them against regular expressions with
a notation with [...], {...} and from expressions using recusiv rules.
I want to emphasize, that


one has not to learn a new grammar, to use the TextTransformer
--------------------------------------------------------------




It is a strong feature of your lexer grammar, that it can handle
nested comments. By regular expressions this is not possible. Non
nesting block comments can be defined with the TextTransformer as:


<comment1b> -> /\*[^*]*\*+([^/*][^*]*\*+)*/


But in other respects regular expressions are more concise than a
lexer grammar. Often, predefined character classes or their negations
are sufficient for the definition of tokens.
The translation of your examples is:


<identifier> -> [A-Za-z_]\w*
<integer> -> \d+
<spaces> -> \s+ // to translate your example exactly: [\t\n ]+
<comment2> -> //[^\n]*




Regards


Detlef Meyer-Eltz






--
mailto:Meyer-Eltz@t-online.de


http://www.texttransformer.de
http://www.texttransformer.com
http://www.texttransformer.org
http://www.text-konverter.homepage.t-online.de


Post a followup to this message

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