473,511 Members | 14,052 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ grammar for ANTLR & C# output

Hi,

I'm looking for ANTLR input file with C++ grammar which is configured for C#
output. Does anybody know where can I find it?
Nov 30 '07 #1
8 4935

"Rami" <ri@gazeta.plwrote in message news:fi**********@inews.gazeta.pl...
Hi,

I'm looking for ANTLR input file with C++ grammar which is configured for
C# output. Does anybody know where can I find it?
I think that the C++ grammar is too complicated for ANTLR syntax.
Dec 3 '07 #2
Ben Voigt [C++ MVP] wrote:
"Rami" <ri@gazeta.plwrote in message news:fi**********@inews.gazeta.pl...
>Hi,

I'm looking for ANTLR input file with C++ grammar which is configured for
C# output. Does anybody know where can I find it?

I think that the C++ grammar is too complicated for ANTLR syntax.

http://www.antlr.org/grammar/list thinks you are wrong: There is a C++
grammar made by David Wigg, but it uses C++ output. So, problem is C#,
not Antlr.

--
Arto Viitanen
Dec 4 '07 #3
Arto Viitanen wrote:
Ben Voigt [C++ MVP] wrote:
"Rami" <ri@gazeta.plwrote in message
news:fi**********@inews.gazeta.pl...
Hi,
>
I'm looking for ANTLR input file with C++ grammar which is
configured for C# output. Does anybody know where can I find it?
I think that the C++ grammar is too complicated for ANTLR syntax.

http://www.antlr.org/grammar/list thinks you are wrong: There is a
C++ grammar made by David Wigg, but it uses C++ output. So, problem
is C#, not Antlr.
It's my understanding that the C++ syntaxis (similar to C) isn't
LR(n) compatible in 100% of the cases (so you WILL get shift/reduce
conflicts).

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Dec 4 '07 #4
Frans Bouma [C# MVP] wrote:
It's my understanding that the C++ syntaxis (similar to C) isn't
LR(n) compatible in 100% of the cases (so you WILL get shift/reduce
conflicts).
But what does that have to do with ANTLR? It is LL parser, and actually
it is something they call LL(*). If I understood it right, the "*" can
be dynamic, and as long as the whole program.

--
Arto Viitanen
Dec 5 '07 #5
Arto Viitanen wrote:
Frans Bouma [C# MVP] wrote:
It's my understanding that the C++ syntaxis (similar to C) isn't
LR(n) compatible in 100% of the cases (so you WILL get shift/reduce
conflicts).

But what does that have to do with ANTLR? It is LL parser, and
actually it is something they call LL(*). If I understood it right,
the "*" can be dynamic, and as long as the whole program.
isn't the LR in antLR stand for LR(n) parser generator? i.e. it
generates the action/goto shift/reduce tables for the generic parser
core?

It's been a while since I've looked at antlr, so I might be mistaken
in this. If AntLR is an LL parser generator, it can be done indeed.
Lookaheads longer than a couple of tokens aren't really recommended
btw. ;)

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Dec 5 '07 #6
Frans Bouma [C# MVP] wrote:
isn't the LR in antLR stand for LR(n) parser generator? i.e. it
generates the action/goto shift/reduce tables for the generic parser
core?
No, antlr generates LL(n) recursive descent parsers, for any 'n' you
like.
It's been a while since I've looked at antlr, so I might be mistaken
in this. If AntLR is an LL parser generator, it can be done indeed.
Lookaheads longer than a couple of tokens aren't really recommended
btw. ;)
Modeled as a state machine (typical for LR parsers), it results in
multiplicative (i.e. combinatorial) explosion; however, antlr uses
rather simpler if-then chaining, trading time for tractability.

-- Barry

--
http://barrkel.blogspot.com/
Dec 5 '07 #7
Frans Bouma [C# MVP] wrote:
Arto Viitanen wrote:
Ben Voigt [C++ MVP] wrote:
>"Rami" <ri@gazeta.plwrote in message
news:fi**********@inews.gazeta.pl...
Hi,

I'm looking for ANTLR input file with C++ grammar which is
configured for C# output. Does anybody know where can I find it?
>
I think that the C++ grammar is too complicated for ANTLR syntax.
http://www.antlr.org/grammar/list thinks you are wrong: There is a
C++ grammar made by David Wigg, but it uses C++ output. So, problem
is C#, not Antlr.

It's my understanding that the C++ syntaxis (similar to C) isn't
LR(n) compatible in 100% of the cases (so you WILL get shift/reduce
conflicts).
Yes, a fully validating C++ is not LR(n) or LL(n) for any n without
helping the lexer with information from the symbol table. Apart from
using lexer feedback, one can be more lenient in the syntax analysis and
use later semantic analysis to fix up the parse tree.

-- Barry

--
http://barrkel.blogspot.com/
Dec 5 '07 #8
Barry Kelly wrote:
Frans Bouma [C# MVP] wrote:
isn't the LR in antLR stand for LR(n) parser generator? i.e. it
generates the action/goto shift/reduce tables for the generic parser
core?

No, antlr generates LL(n) recursive descent parsers, for any 'n' you
like.
ah, thanks for clearing that up.

FB
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Dec 6 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1860
by: Patrick L. Nolan | last post by:
I'm going nuts trying to port an application from Linux to Windows. We have a python/Tkinter script which runs a C++ application. It starts it with popen4 and communicates through the two pipes....
2
7743
by: Trevor | last post by:
Hello, Please bear with me, I am trying to learn C++. I am implementing some error/debug functions which format a message and output it to a C++ stream. I would like to design it using one low...
7
7870
by: LineVoltageHalogen | last post by:
Greetings All, I have a very large query that uses dynamic sql. The sql is very large and it requires it to be broken into three components to avoid the nvarchar(4000) issue: SET @v_SqlString(...
1
1588
by: hapa | last post by:
I want to write a program that take a name of a person and also a name of a jpeg file with known destination and create an output on an HTML format but it should also display the picture help me out...
2
2002
by: ayan4u | last post by:
ok i have two problems... firstly in strict C enviornment is it possible to have a true dynamic charecter array with no predefined length...i mean to say... suppose.. char *array =NULL;...
16
4811
by: Okonita via DBMonster.com | last post by:
Hi all, I am comming along with all this Linus/DB2/scripting business...I am no longer scared of it!! (LOL). But, I need to create a .ksh script that does a REORGCHK and output only tables...
0
1855
by: AliAmjad | last post by:
Hello All, How can I read from standard input and write to standard output. System.Diagnostics.Process.StandardInput's MSDN reference didn't help as it separately starts the process and then...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.