Solved

I need to create SIMPLE .class file, without compiler

Posted on 2004-04-01
9
205 Views
Last Modified: 2008-03-04
Hi,
I am doing a project for school grade.
I need to do a compiler like thing.
It should convert a simple java code into java.class file
it can be simplest like
there is a public string variable, and it is printed....
I can give variable name and the code should generate .class file
I meant that a software that puts java class structure and then the insert the variable value
I would like it in Visual Basi, but if you can give me some guidelines then I can develop....
Thanks in advance
With regards
0
Comment
Question by:trymyservice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10731611
I hope, this would help your need

http://www.openjit.org/docs/backend-internal/
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 10733900
Back in 1971 I broke my leg so I had to lay down for 6 weeks.
In that time I wrote a compiler for a bookkeeping machine.
The approach is simple: write a program that recognises words and output calls to methods that do what
the input wants. We call that a threaded code system. So it translates one language into another.


And do not try to duplicate a JAVA compiler for a school project: you will die in tears.

;JOOP!
0
 

Author Comment

by:trymyservice
ID: 10739102
I am sorry but I think that this has to do with JAVA and I need procedure not necessarly in VB.
Here is bit more I could find

Say in applet there is only one variable wstr="HELLO"
and if I make .class out of this (taking differnent value of wstr....)

Class file contains these data
Êþº¾ + somefixeddata + somevariabledata + HELLO + someanotherfixeddata

So if I can know how to generate  somevariabledata  then my problem is solved !!!!

so my solution will be adding these all data and save as .class file ....

need to know how somevariabledata varies ???

Thank you
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:trymyservice
ID: 10739105
I am sorry but I think that this has to do with JAVA and I need procedure not necessarly in VB.
Here is bit more I could find

Say in applet there is only one variable wstr="HELLO"
and if I make .class out of this (taking differnent value of wstr....)

Class file contains these data
Êþº¾ + somefixeddata + somevariabledata + HELLO + someanotherfixeddata

So if I can know how to generate  somevariabledata  then my problem is solved !!!!

so my solution will be adding these all data and save as .class file ....

need to know how somevariabledata varies ???
And sir, I know that I am not going for a compiler... just Manipulator or something like that !!!
Thank you
0
 

Accepted Solution

by:
RobCSP earned 63 total points
ID: 10739486
If you want to create a compiler the first step is create a lexical analyzer, i recommend you JFLEX,JFlex is a lexical analyzer generator for Java written in Java. It is also a rewrite of the very useful tool JLex [3] which was developed by Elliot Berk at Princeton University.

You can take an useful manual in http://www.ugrad.cs.ubc.ca/~cs411/docs/manual.html


I hope that it helps,
ROB
0
 
LVL 13

Assisted Solution

by:Webstorm
Webstorm earned 62 total points
ID: 10740259
Hi trymyservice,

Here, you can find the class format specification :

http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#80959
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

632 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