Loading ...
Sorry, an error occurred while loading the content.

Re: [antlr-interest] Ter, Would you mind looking at ....

Expand Messages
  • Sinan
    ... Ok, I did a fast hack on it. 1) set AST generation to true, 2) changed the file name comparison to convert the extension to lower case before comparison. (
    Message 1 of 1 , Aug 31, 2000
    • 0 Attachment
      danreo@... wrote:
      >
      >
      > Hello Ter:
      >
      > Would you mind looking at the Pascal grammer in the
      > antlr-2.7.0\example\java\pascal\pascal.g
      > This grammer will not take and run the test cases
      > given within the example code.
      >
      > It will run thru the Antlr generator and compile in Javac.
      > But won't run the first testcase.
      >


      Ok, I did a fast hack on it.

      1) set AST generation to true,
      2) changed the file name comparison to convert the extension
      to lower case before comparison. ( otherwise it would work
      in MS environ where upper==lower, but not in Unix.
      3) Put in a tree action so that you can see the tree generated.

      after building, type in

      % java PascalParser -showtree P_0_1.PAS


      -----------------------------

      However I am a little confused abot what you are trying
      to do with this. I hope you realize that this will not
      generate or execute the parsed object. It has no
      interpreter , or executable code generator. It will
      only parse and get out. So when it says parsing,
      that is all you will get. Unless there are errors in
      the pascal source code......

      I have not looked at this example before. It appears
      to be very cleanly written. ( And I noticed written
      by another Turk.. like myself....)

      Anyway, if you want to pursue this, I will help you. But
      you wil have to put in the treewalker/interpreter.

      tinybasic is an example of an interpreter. as far
      as I know it is the only one that does interpretation
      other than the calcAST example....

      Sinan
    Your message has been successfully submitted and would be delivered to recipients shortly.