Solved

I need to create SIMPLE .class file, without compiler

Posted on 2004-04-01
9
204 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
String array comparison 4 57
Problem to Alipay 10 94
JDBC performance 8 35
Setup Eclipse for Andriod development 2 19
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.
Suggested Courses

739 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