473,320 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Compiler Construction

Max
I am working in vb.net to devlope a c++ compiler that will read the
whole .cpo file and search for the keywords ,identiferis,opertaors and
others and also check the syntax for the whole code.

SO would any body there to tell about any algorithem which will serach
the whole .cpp file and return me that file into an array (ervry index
of array hold one word.)

sO PLZ HELP mE AS SOON AS POSSIBLE

From myside any information will be regarded.
Jan 17 '08 #1
4 1853
Max wrote:
SO would any body there to tell about any algorithem which will serach
the whole .cpp file and return me that file into an array (ervry index
of array hold one word.)
Start here:

http://www.amazon.com/Compilers-Prin.../dp/0201100886

Ebbe
Jan 17 '08 #2
Max wrote:
I am working in vb.net to devlope a c++ compiler that will read the
whole .cpo file and search for the keywords ,identiferis,opertaors and
others and also check the syntax for the whole code.

SO would any body there to tell about any algorithem which will serach
the whole .cpp file and return me that file into an array (ervry index
of array hold one word.)

sO PLZ HELP mE AS SOON AS POSSIBLE

From myside any information will be regarded.
I think your description here requires two quite different algorithms.

The first, to find all words used in a given text, just split out on any
non-text characters. You can use the Char class in .NET and its various
static methods for checking if a character is a digit, letter, symbol, etc.

If you construct a list of such delimited characters, you can pass this
to String.Split to split an existing strings into words.

However, to "check syntax for the whole code", in this you essentially
have to build a parser that understands C++ syntax. For this solution I
would really like to know why you want to do this.

--
Lasse Vågsæther Karlsen
mailto:la***@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jan 17 '08 #3
On Jan 17, 4:12 am, Lasse Vågsæther Karlsen <la...@vkarlsen.nowrote:
Max wrote:
I am working in vb.net to devlope a c++ compiler that will read the
whole .cpo file and search for the keywords ,identiferis,opertaors and
others and also check the syntax for the whole code.
SO would any body there to tell about any algorithem which will serach
the whole .cpp file and return me that file into an array (ervry index
of array hold one word.)
sO PLZ HELP mE AS SOON AS POSSIBLE
From myside any information will be regarded.

I think your description here requires two quite different algorithms.

The first, to find all words used in a given text, just split out on any
non-text characters. You can use the Char class in .NET and its various
static methods for checking if a character is a digit, letter, symbol, etc..

If you construct a list of such delimited characters, you can pass this
to String.Split to split an existing strings into words.

However, to "check syntax for the whole code", in this you essentially
have to build a parser that understands C++ syntax. For this solution I
would really like to know why you want to do this.
I, too, would like to know why he *urgently* needs to develop a C++
compiler, in VB.NET, and is asking about it on a C# newsgroup.

Jesse
Jan 18 '08 #4

"Jesse McGrew" <jm*****@gmail.comwrote in message
news:de**********************************@k2g2000h se.googlegroups.com...
On Jan 17, 4:12 am, Lasse Vågsæther Karlsen <la...@vkarlsen.nowrote:
Max wrote:
I am working in vb.net to devlope a c++ compiler that will read the
whole .cpo file and search for the keywords ,identiferis,opertaors and
others and also check the syntax for the whole code.
SO would any body there to tell about any algorithem which will serach
the whole .cpp file and return me that file into an array (ervry index
of array hold one word.)
sO PLZ HELP mE AS SOON AS POSSIBLE
From myside any information will be regarded.

I think your description here requires two quite different algorithms.

The first, to find all words used in a given text, just split out on any
non-text characters. You can use the Char class in .NET and its various
static methods for checking if a character is a digit, letter, symbol,
etc.

If you construct a list of such delimited characters, you can pass this
to String.Split to split an existing strings into words.

However, to "check syntax for the whole code", in this you essentially
have to build a parser that understands C++ syntax. For this solution I
would really like to know why you want to do this.
>I, too, would like to know why he *urgently* needs to develop a C++
compiler, in VB.NET, and is asking about it on a C# newsgroup.

Sounds like the course "Compiler Construction" to me. I had the exact same
lab exercise when I studied it at university (although the languages
differed). Maybe the OP is running late with his assignments...
/claes



Jan 18 '08 #5

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

Similar topics

34
by: Nikola Skoric | last post by:
Is the a PHP compiler? A program that compiles PHP code to executable which doesn't need php interpreter to execute... -- Pozdrav/Regards, Nikola Skoric. "...Usne, tice-rugalice - a u oku...
15
by: Anton Gavrilov | last post by:
Hi all, I seek your advice on where to start if I want to write a compiler for a toy C-like language I invented (or, rather, am in the process of inventing). Yes, yes, I know I'm crazy and the...
6
by: Sebastian | last post by:
Do you have a simple example for creating a simple hello world compiler in c# or vb.net? thanks Sebastian
5
by: Stuart Carnie | last post by:
I suspect it's unlikely, but you'll never know until you ask, but are there any attributes that would allow us to contribute to the compiled output? e.g. // this class exists in a separate,...
18
by: smnoff | last post by:
Ok, I am think I am a little more knowledgeable about C and pointers, ughh. And likewise, I want to fix C.....and not so much to make a C++ or Java or C# or even D like language. So, if I...
6
by: JohnQ | last post by:
I like, non-copyable, non-assignable and, most often, non-default-constructable also, as a starting point for class design: class SomeClass { SomeClass(); // disallow default construction...
43
by: JohnQ | last post by:
Are a default constructor, destructor, copy constructor and assignment operator generated by the compiler for a struct if they are not explicitely defined? I think the answer is yes, because...
20
by: Nickolai Leschov | last post by:
Hello all, I am programming an embedded controller that has a 'C' library for using its system functions (I/O, timers, all the specific devices). The supplied library has .LIB and .H files. ...
8
by: =?GB2312?B?yum09MXt?= | last post by:
today I forgot to include some header,then I found the error message by the compiler is quite strange. so I want to know exactly the inner details of the compiler impletation,if possible. and I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.