473,378 Members | 1,478 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,378 software developers and data experts.

compiler front-end

hi all ,

I am willing to write a compiler front-end for my semester
project . I am studying compilers in my present semester and I am
following the Dragon Book for the theory and Allen I. Holub's Compiler
Design in C for the _actual stuff_ .
.. Although I must admit that as of now I am not able to make out
much out of Holub's book since I am not through with the theory yet
but I have come to understand that it would be much easier to go
through it once I complete the theory . As of now I am almost done
with the front-end theory and so I want to design a compiler front-end
( lexer and parser ) .
Now there are certain issues that i am facing . First of all,
I need to have a grammar so that I would know what all terminals
( tokens ) I have to use . This would be required for the design of
the lexer . Having the grammar would also solve many issues regarding
the parser too .
Can anyone suggest me a simple context-free grammar ? I'd
highly appreciate it . I would also stick to this thread for any other
issues that I face while designing the front-end .
Thanking in anticipation . Vaib .
Nov 17 '08 #1
1 1954
In article <e35d57b1-6e9f-4ec7-9529-
b3**********@c2g2000pra.googlegroups.com>, va************@gmail.com
says...
hi all ,

I am willing to write a compiler front-end for my semester
project . I am studying compilers in my present semester and I am
following the Dragon Book for the theory and Allen I. Holub's Compiler
Design in C for the _actual stuff_ .
. Although I must admit that as of now I am not able to make out
much out of Holub's book since I am not through with the theory yet
but I have come to understand that it would be much easier to go
through it once I complete the theory . As of now I am almost done
with the front-end theory and so I want to design a compiler front-end
( lexer and parser ) .
Now there are certain issues that i am facing . First of all,
I need to have a grammar so that I would know what all terminals
( tokens ) I have to use . This would be required for the design of
the lexer . Having the grammar would also solve many issues regarding
the parser too .
Can anyone suggest me a simple context-free grammar ? I'd
highly appreciate it . I would also stick to this thread for any other
issues that I face while designing the front-end .
The usual is to design a grammar for a small language of your own.
Usually for a start, you can basically just have the usual computations
(addition, subtraction, multiplication and division) and assignments to
variables, along with the ability to print out results (or possibly just
print out the result from every computation).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Nov 19 '08 #2

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

Similar topics

7
by: No Spam | last post by:
----snip #define POSITIVE_INTEGRATOR_SATURATION 0x03000000L // #define NEGATIVE_INTEGRATOR_SATURATION 0xFD000000L // long integrator; integrator=0;
5
by: Kim Nørby Andersen | last post by:
Hello there I am lost. i receive the output in the bottom, from a site that runs excellently on our development server, but dies on the customer. We have had a first version running at the...
7
by: Chameleon | last post by:
This code below compiles fine with VS.2005 but with gcc 3.4.2 not. ------------------ template<class T> static void Wastage1D::clever_erase(vector<T> &v, vector<typename vector<T>::iterator>...
9
by: Christof Warlich | last post by:
Hi, consider this: template<typename Tclass X { public: void doSomething(T t); }; int main(void) { X<intx;
3
by: trond.norbye | last post by:
Hi I am trying to compile a quite large software system with a new compiler. During that attempt I am facing problems during the link phase, and I have traced it down to the following construct:...
43
by: Jeremy Thomson | last post by:
I want to do some simple programming at home on my new Vista PC. Its to automate moving .AAC files to my phone's mercury card. (Nokia's application only works with USB cable or bluetooth). So the...
4
by: Break2 | last post by:
I am new to C++ and am currently using Visual Studio 2005 after having first tried Borland C++ Builder 6.0 and CodeGear C++ Builder 2007. The thing I like about Visual Studio 2005 is the 'step over'...
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. ...
9
by: bacbacdinner | last post by:
Can anyone explain to me why the code below generates a warning? ///////////////////////////////////////////////////////////// typedef struct testStruct * TestStructRef; typedef TestStructRef * ...
3
by: Unknownmat | last post by:
Here is the smallest code I could come up with to reproduce the I was able to reproduce the warning with an even smaller snippet of code: #include <vector> #include <functional> #include...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.