Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Simple Java compiler

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Simple Java compiler

    i'm trying to write a compiler code that read file of C++ code and check the Error's inside it . I need better Idea than what I Do . to check errors . .. just simple example for idea no more .this is my function of compile and have a wrong code but just I want share the ideas so that help me to make my code . because i lost .Thank you

    public void Myfun1()
    { 
    JFileChooser chooser = new JFileChooser();
    chooser.showOpenDialog(null);
    File f =chooser.getSelectedFile();
    String filename=f.getAbsolutePath();
    BufferedReader br;
    try {
    br = new BufferedReader(new FileReader(filename));
    String line;
    while ((line = br.readLine()) != null) {
    String[]sytanxError={"int" ,"float", "double" , "cin" , "cout"};
    for(int i=0;i < sytanxError;++i)
    {
    if(line.equals(sytanxError))
    {
     
    {
     
     
    } 
    }
    }
    br.close();
     
    }
     
    catch (FileNotFoundException ex) {
    Logger.getLogger(guiconcept.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
    Logger.getLogger(guiconcept.class.getName()).log(Level.SEVERE, null, ex);
    }


  2. #2
    Member coderxx0's Avatar
    Join Date
    Feb 2013
    Location
    England, UK
    Posts
    58
    My Mood
    Daring
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Simple Java compiler

    Quote Originally Posted by cazanova View Post
    i'm trying to write a compiler code that read file of C++ code and check the Error's inside it . I need better Idea than what I Do . to check errors . .. just simple example for idea no more .this is my function of compile and have a wrong code but just I want share the ideas so that help me to make my code . because i lost .Thank you

    public void Myfun1()
    { 
    JFileChooser chooser = new JFileChooser();
    chooser.showOpenDialog(null);
    File f =chooser.getSelectedFile();
    String filename=f.getAbsolutePath();
    BufferedReader br;
    try {
    br = new BufferedReader(new FileReader(filename));
    String line;
    while ((line = br.readLine()) != null) {
    String[]sytanxError={"int" ,"float", "double" , "cin" , "cout"};
    for(int i=0;i < sytanxError;++i)
    {
    if(line.equals(sytanxError))
    {
     
    {
     
     
    } 
    }
    }
    br.close();
     
    }
     
    catch (FileNotFoundException ex) {
    Logger.getLogger(guiconcept.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
    Logger.getLogger(guiconcept.class.getName()).log(Level.SEVERE, null, ex);
    }
    its looking good but we cannot help you write the code all we can do is advise

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Simple Java compiler

    If you want to clear your doubts just go for -link removed-com I am sure they can help you.
    Last edited by jps; May 29th, 2013 at 03:35 AM. Reason: links

Similar Threads

  1. develop compiler in java
    By olfat in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 22nd, 2013, 08:48 AM
  2. Creating a Compiler in Java
    By Superstar288 in forum Java Theory & Questions
    Replies: 20
    Last Post: February 22nd, 2013, 08:05 AM
  3. Java Online Compiler
    By sb24 in forum Java Theory & Questions
    Replies: 15
    Last Post: March 23rd, 2012, 09:50 AM
  4. Java 6.0 Compiler Error
    By jilomes in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 19th, 2011, 04:34 PM
  5. How to set java compiler compliance with command under Linux
    By Eric97 in forum Java Theory & Questions
    Replies: 2
    Last Post: November 9th, 2010, 08:25 AM

Tags for this Thread