• Post Reply Bookmark Topic Watch Topic
  • New Topic

How To Create The Compiler For my own Language and how will tokenize the Strings  RSS feed

 
Balajee Kannan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My compilerwill be made by Javascript.So,Tell your idea and also coding for Javascript. Hai Friends Please Help for my Usefull projects.......
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Several points in no particular order:
  • Just to clarify: You want to write a compiler in JavaScript, or for JavaScript?
  • If the former, then it will be rather limited, because JS lacks a number of facilities you'd need for that.
  • If the latter, then you need a parser for it - check out JavaCC, Antlr or SableCC. For Antlr in particular a JS grammar is available.
  • Are you familiar with Rhino, which is a JavaScript interpreter and compiler written in Java?
  • Please don't post the same question several times.
  • I'm obviously missing something, because this is the "Sockets and Internet protocols" forum, and I see nothing related to that in your question.

  •  
    Mark Spritzler
    ranger
    Sheriff
    Posts: 17309
    11
    IntelliJ IDE Mac Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Read about the Interpreter Design Pattern.

    Mark
     
    Layne Lund
    Ranch Hand
    Posts: 3061
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    This forum is for Socket and Internet programming in Java which is not at all related to JavaScript. I don't think it is even possible to write a compiler in JavaScript. You might be able to write an interpreter, however. Either way, this project is fairly complex and would probably be better implemented in another language such as Java or C++. There are tools for both of these languages that help in writing a compiler/interpreter.

    If you can provide some more details about what you intend to do, we will be able to point you in the right direction to get started.

    Layne
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!