Solved

A pascal or delphi syntax checker...

Posted on 2000-03-10
6
921 Views
Last Modified: 2013-11-18
hi...
the uni asked me to make a Delphi compiler..( not a compiler... just to check the statments syntax... no output are needed)... so, who can help me with that? am busy with my project, and i cant find time to learn java..?
so plz help me..
am using JDK compiler..
0
Comment
Question by:LoneReck
  • 3
  • 3
6 Comments
 
LVL 8

Accepted Solution

by:
diakov earned 400 total points
ID: 2607936
Here you can find what you want:
http://www.cocolsoft.com.au/dgram/dgramh.htm (i'm not sure for the source files)

If you want to do i t yourself, check out the following resource for grammars:
http://www.cobase.cs.ucla.edu/pub/javacc/
for the parser generator (the best one can get) at
http://www.metamata.com/JavaCC/
You may also want to use the http://www.cs.purdue.edu/jtb/ product that generates even more code for you if you want to build something more than a parser.

I couldn't find Pascal grammar for JavaCC, however, I think you can easily make it yourself using one of the examples.

Cheers,
  Nikolay
0
 
LVL 8

Expert Comment

by:diakov
ID: 2607954
http://www.cs.may.ie/~jpower/Oberon/

Oberon is an extension of Pascal, and there is a JavaCC grammar for it, just modify a bit.

Cheers,
  Nik
0
 

Author Comment

by:LoneReck
ID: 2608219
Well.. can i use JDK to compile the code??
or it can be dont with JCC only??
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:LoneReck
ID: 2608220
Well.. can i use JDK to compile the code??
or it can be done with JCC only??
0
 

Author Comment

by:LoneReck
ID: 2608225
sorry,, am a good programmer..
but i know nothing about java cuz i never used it,,, and i have no time...
so... help me with the last quistion..
0
 
LVL 8

Expert Comment

by:diakov
ID: 2608427
Sorry for the delay, time zones, etc.

JavaCC takes as input a formal description (line BNF) of a language, called grammar. The it generates compilable (by JDK) code that recognizes text written in the language the grammar describes.

Furthermore, JTB  additionally generates an expression (program) tree builder that helps you automate the semantics implementation for a particular program.

The process is quite common, like yacc and lex for C. One generates the parser, the other, the lexical analysis. You may be need only the parser.

To summarize, you create the input for JavaCC, you use the code generated from JavaCC. If you need to, use JTB for more sophisticated programming.






0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Where to store the queries for modification of table 4 52
print map entry 34 53
windows explorer path to command prompt 5 27
Message not shown 5 26
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now