Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    dinosoep is offline Senior Member
    Join Date
    Nov 2009
    Posts
    150
    Rep Power
    5

    Default

    dimitry,
    first of all congrats :)
    can you please enlighten me what you used? I have been playing around with yacc and generated very basic stuff. But I want to take it to the next level, but I am stuck at deciding what to use to compile it: cross compile to java or trying to generate low level jasm code.

    I understand this is not open source but I really would be interested in how you handled closures and the goto operator if you generate java source code.

  2. #22
    pld
    pld is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default

    Hello,

    * goto can be emulated using labeled for loops combined with break, continue and switch. You can not jump inside some block, but you can jump outside or to any statement of the same block.

    * closure can be emulated by an inner class implementing java.util.concurrent.Callable and extending some other abstract class AbsractClosure for getting all variables it needs as array in extra method init(Objects[]) after the constructor is called, so that the java limitation to access only final variables from inner classes does not hurt.
    PHP Code:
    AbsractClosure closure = new AbsractClosure()
    { 
    void init(Object[]) {...} 
    @override void setParams(Object[]) {...}
    Object call() {...}
    }
    Dimitry
    Last edited by pld; 08-08-2010 at 01:47 PM.

  3. #23
    pld
    pld is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 5
    Last Post: 08-25-2009, 09:41 AM
  2. Creating a new programming language?
    By hawaiifiver in forum Forum Lobby
    Replies: 0
    Last Post: 03-21-2009, 08:46 PM
  3. Is this the right language?
    By rws in forum New To Java
    Replies: 9
    Last Post: 11-15-2008, 03:27 PM
  4. IDE for new language
    By mitra2008 in forum Eclipse
    Replies: 2
    Last Post: 06-23-2008, 06:43 PM
  5. V language 0.004
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-19-2007, 03:18 PM

Posting Permissions

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