Changeset 2755


Ignore:
Timestamp:
Dec 7, 2012, 9:26:17 PM (7 years ago)
Author:
ksherdy
Message:

Minor refactoring wrt PabloS / PabloB.

Location:
proto/pablo/src
Files:
5 added
2 edited
4 moved

Legend:

Unmodified
Added
Removed
  • proto/pablo/src/applications/ApplicationOptions.java

    r2739 r2755  
    7676          public static void exitWithUsageMessage(Options options) {
    7777            HelpFormatter h = new HelpFormatter();
    78             h.printHelp("java " + Pablo.COMPILERNAME + "\n", options);
    79             System.exit(Pablo.EXIT_CODE_FOR_ERROR);
     78            h.printHelp("java " + PabloS.COMPILERNAME + "\n", options);
     79            System.exit(PabloS.EXIT_CODE_FOR_ERROR);
    8080          }       
    8181         
  • proto/pablo/src/applications/PabloS.java

    r2749 r2755  
    2525@SuppressWarnings("unused")
    2626
    27 public class Pablo {
     27public class PabloS {
    2828       
    2929        public static final String COMPILERNAME = "PabloJ";     
  • proto/pablo/src/compiler/codeGenerator/helpers/Generators.java

    r2749 r2755  
    99import compiler.transformers.visitors.helpers.CodeStore;
    1010
    11 import ast.*;
     11import pabloS.ast.*;
    1212
    1313public class Generators {
  • proto/pablo/src/test/pabloS/PabloSTestHarness.java

    r2749 r2755  
    44//
    55
    6 package  applications;
     6package  test.pabloS;
    77
    88import java.io.File;
     
    3434
    3535@SuppressWarnings("unused")
    36 public class TestPabloS {
     36public class PabloSTestHarness {
    3737
    3838        protected static final int EXIT_CODE_FOR_ERROR = 1;
  • proto/pablo/src/test/pabloS/grammar/PabloApplication.java

    r2710 r2755  
    33// See applications.SampleApplication.java.
    44//
    5 package grammar;
     5package test.pabloS.grammar;
    66
    77import java.io.File;
  • proto/pablo/src/test/pabloS/grammar/TestPabloSAST.java

    r2749 r2755  
    1 //
    2 // This code is modified scatter parser-generator code.
    3 // See applications.SampleApplication.java.
    4 //
    5 package grammar;
     1/*
     2 * Ken Herdy
     3 * December 7 2012
     4 *
     5 * Quick and dirty test program to test PabloS grammar parser without error.
     6 *
     7 * Input:       Top-level directory that contains *.pablo (PabloS) files.
     8 * Output:      If no syntax errors then prints AST Else print exception message.
     9 * 
     10 */
     11 
     12package test.pabloS.grammar;
    613
    714import java.io.BufferedReader;
     
    2330import java.util.List;
    2431
    25 /**
    26  * Recursive Func to descend into the directory tree and find all the files
    27  * that end with ".mp3"
    28  * @param dir A file object defining the top directory
    29  **/
     32public class TestPabloSAST extends SampleApplication {
    3033
    31 public class TestPabloSAbstractSyntaxTree extends SampleApplication {
    32         /** Prints abstract syntax tree of a Sample file.
    33          *  Prints errors if syntax incorrect.
    34          * @param args
    35          * @throws FileNotFoundException
    36          */
    3734        public static void main(String[] args) throws FileNotFoundException {
    38                 PabloApplication.checkArgs(args, "SampleAbstractSyntaxTree");
     35                PabloApplication.checkArgs(args, "TestPabloSAST");
    3936               
    4037                ASTPrinter.setPrintLevel(ASTPrinter.Level.FULL);
     
    5451                                System.out.println(file2String(f));
    5552                        } catch (IOException e) {
    56                                 // TODO Auto-generated catch block
    5753                                e.printStackTrace();
    5854                        }
     
    6561        }
    6662       
    67         /** analyzes a file specified by filename.
    68          * @param filename the name of the file to be analyzed.
    69          * @throws FileNotFoundException
    70          */
    7163        public static void parseFileToAST(String filename, PrintStream out) throws FileNotFoundException {
    7264                LexicalController lexController     = LexicalController.make(filename);
    73                 ASTNode syntaxTree    = Parser.parse(lexController);
     65                ASTNode syntaxTree                              = Parser.parse(lexController);
    7466               
    7567                out.print(syntaxTree);
     
    109101       
    110102    public static String delimeterLine() {
    111         return new String("--------------------------------------------------------------------------------");
     103        return new String("---");
    112104    }
    113105   
    114 
    115 
    116106}
Note: See TracChangeset for help on using the changeset viewer.