From: Joseph M. Newcomer on
But lex does not use regexp recognizers at all! Instead, it takes a regexp as a
specification and GENERATES information for doing lexical analysis with a FSM recognizer,
which becomes a component of a compiler based most commonly on yacc.

So are you talking about input to lex? If so, say so. Otherwise, the assumption is that
you are working with some regexp recognizer subroutine such as those found in codeproject.
Or the one found in the FreeBSD library. Do a google search for CRegExp and find all the
available libraries. Otherwise, you would have said "I'm using lex, and I have this
question about its input". And the answer is, if you are not talking about lex, you are
going after the problem in the wrong way.

If you are working with lex and yacc, there are newsgroups devoted to these topics in the
comp hierarchy. If you ask about regexp in this NG, we will assume you are talking about
the kinds of libraries that exist that you can call from C++.
joe

On Thu, 13 May 2010 06:50:50 -0500, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Mihai N." <nmihai_year_2000(a)yahoo.com> wrote in message
>news:Xns9D771E851DEFBMihaiN(a)207.46.248.16...
>>
>>> I am writing a compiler that takes UTF-8 input, so I must
>>> have a correct regular expression to be used by the
>>> lexical
>>> analyzer.
>>
>> The more I look at them, the wronger they seem :-)
>> Really, if you write a compiler, then forger regexp.
>
>Ah maybe you are saying forget regexp, I can't because the
>compiler is based on lex and yacc. I am writing a simplified
>C++ interpreter by slightly modifying the correct lex and
>yacc syntax for "C".
>
>>
>>
>>
>> --
>> Mihai Nita [Microsoft MVP, Visual C++]
>> http://www.mihai-nita.net
>> ------------------------------------------
>> Replace _year_ with _ to get the real email
>>
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Peter Olcott on

"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in
message news:e96ou5taaufi8fqmmmaf0dl7m2hkn69po8(a)4ax.com...
> If you are working with lex and yacc, there are newsgroups
> devoted to these topics in the
> comp hierarchy. If you ask about regexp in this NG, we
> will assume you are talking about
> the kinds of libraries that exist that you can call from
> C++.
> joe

I already tried comp.compilers, and am aware of no lex or
yacc specific groups.


From: Joseph M. Newcomer on
Well, it has been a long number of years since I last was there. They may have evaporated
due to lack of activity.
joe

On Thu, 13 May 2010 11:35:13 -0500, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in
>message news:e96ou5taaufi8fqmmmaf0dl7m2hkn69po8(a)4ax.com...
>> If you are working with lex and yacc, there are newsgroups
>> devoted to these topics in the
>> comp hierarchy. If you ask about regexp in this NG, we
>> will assume you are talking about
>> the kinds of libraries that exist that you can call from
>> C++.
>> joe
>
>I already tried comp.compilers, and am aware of no lex or
>yacc specific groups.
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Mihai N. on
> Ah maybe you are saying forget regexp
Just a typo, and your guess is right, it was "forget"

> I can't because the
> compiler is based on lex and yacc. I am writing a simplified
> C++ interpreter by slightly modifying the correct lex and
> yacc syntax for "C".
Ok, see joe's comments about using regexp for compilers.


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

From: Mihai N. on
> I can't because the
> compiler is based on lex and yacc. I am writing a simplified
> C++ interpreter by slightly modifying the correct lex and
> yacc syntax for "C".

Saying that the expresion is used with lex/yacc context makes a big
difference, because that implies that there is a state machine
somewhere that can track the context.

Otherwise it is like saying
I am writing a compiler that takes C input
then show a regular expressions like if|else|while|do
that you use to detect the C keywords.
A regexp using that will accept "bif" as input, lex will not :-)


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email