CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2010
    Posts
    2

    Java interpreter in Java

    Hi all,

    I need to write a simple Java applet that can receive java code,interpret it and display the output. Is there any Java package for Java-interpretation I can use in my applet to do that?

    thanks in advance,
    ArielS

  2. #2
    Join Date
    Jul 2005
    Location
    Currently in Mexico City
    Posts
    568

    Re: Java interpreter in Java

    a simple Java applet that can receive java code,interpret it and display the output
    - Just read the String/file with Java code and print it out in applet;
    - Adding word "simple" won't make the task such, code parsers are never simple;
    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P
    willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

  3. #3
    Join Date
    Apr 2010
    Posts
    2

    Re: Java interpreter in Java

    I know parsing code, especially for a rich language such as Java ,is more than just a simple task. What I meant was I want to write an applet that all it does is receives code from the user by String / File, uses some existing (hopefully) Java-interpretation tool and displays the output of the given code. My hope is that such package exists, with some static methods allowing me to do something like:

    String code = ...
    String output = JavaInterpreter.interpret(code);

    (And maybe throws exceptions when the code has problems).
    I don't understand your first point: "Just read the String/file with Java code and print it out in applet" - how exactly can it help me achieve my goal?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured