Results 1 to 7 of 7

Thread: Generic parser for source code, etc. to share

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Just read through that - wow that is some darn nice code. Nothing like the SVN of prometheus you have 400 odd lines of perfection, I give you 1200 lines of functionality held together with duct tape ARGGGH! No not really, I'm re-organising the source (cant make heads or tails of it any more XD) But I must say I can't wait to see how this project turns out. So good luck.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  2. #2
    Quote Originally Posted by code_glitch View Post
    Just read through that - wow that is some darn nice code. Nothing like the SVN of prometheus you have 400 odd lines of perfection, I give you 1200 lines of functionality held together with duct tape ARGGGH! No not really, I'm re-organising the source (cant make heads or tails of it any more XD) But I must say I can't wait to see how this project turns out. So good luck.
    Wow! Thanks for the nice comments mate

    I don't think my code is THAT good LOL

    I do like your description - "1200 lines of functionality held together with duct tape", but I am sure it isn't that bad

    Good luck with Prometheus man...looking forward to more of your project

    PS, I have discovered a small bug in the TBasePaser.Execute method where I was calling GetToken once too many times! D'OH!

    Here is the correct version of the method:

    Code:
    function  TBaseParser.Execute(const aSrcStream,aDstStream: TStream): Boolean;
    begin
      FSrcStream := aSrcStream;
      FDstStream := aDstStream;
    
      FErrorMsg := '';
      Result    := True;
    
      // initialize parser
      GetCharacter;
      GetToken;
    
      try
        ParseInput; // override this to make a proper parser
      except
        on E:Exception do
        begin
          FErrorMsg := E.Message;
          Result    := False;
        end;
      end;
    end;
    cheers,
    Paul

  3. #3
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Ah, object oriented code or (OOP because when it screws up you go OOOOPS) nah just kidding. Anyway, like I said, good luck and it's looking good so far - might even be using this one day
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  4. #4
    hahaha! OOOOPS!

    cheers,
    Paul

Bookmarks

Posting Permissions

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