Changeset 2952


Ignore:
Timestamp:
Mar 20, 2013, 1:15:54 PM (5 years ago)
Author:
ksherdy
Message:

Restructed PabloJ compile to provide clear separation between PabloS and PabloB.

Location:
proto/pabloj/trunk
Files:
80 added
16 deleted
5 edited
14 copied
6 moved

Legend:

Unmodified
Added
Removed
  • proto/pabloj/trunk/output/cpplang/pablo_definitions.hpp

    r2927 r2952  
    11// GENERATED CODE. DO NOT MODIFY.
     2//
     3// This template includes the minimal set of runtime support libraries required
     4// to support compilation of PabloJ generated C++ code (bitblock.hpp, carryQ.hpp,
     5// pabloSupport.hpp, error_tracker.hpp)
    26//
    37// (c) 2012, 2013 Robert D. Cameron, Ken Herdy
     
    1721
    1822// runtime libraries
    19 #include <lib/simd-lib/bitblock.hpp>
    20 #include <lib/simd-lib/carryQ.hpp>
    21 #include <lib/simd-lib/pabloSupport.hpp>
     23#include <simd-lib/bitblock.hpp>
     24#include <simd-lib/carryQ.hpp>
     25#include <simd-lib/pabloSupport.hpp>
    2226
    2327// migrate error tracker, line/column tracker to compiler runtime
    24 #include <util/ErrorTracker.h>
     28#include <ErrorTracker.h>
    2529ErrorTracker error_tracker;
    2630
     
    3640#include <sys/stat.h>
    3741
    38 #include "../lib/simd-lib/s2p.hpp"
    39 #include "../lib/simd-lib/buffer.hpp"
    40 #include "../lib/simd-lib/bitblock_iterator.hpp"
    41 #include "../lib/simd-lib/perflib/perfsec.h"
     42#include <simd-lib/s2p.hpp>
     43#include <simd-lib/buffer.hpp>
     44#include <simd-lib/bitblock_iterator.hpp>
     45#include <simd-lib/perflib/perfsec.h>
    4246
    4347#include <xmldecl.h>
     
    291295                }
    292296                u8.unibyte = simd_not(basis_bits.bit_0);
    293                 u8.suffix = simd<1>::constant<0>();
    294                 BitBlock u8_error = simd<1>::constant<0>();
    295                 BitBlock u8_FFFE_FFFF = simd<1>::constant<0>();
    296                 BitBlock u8anyscope = simd<1>::constant<0>();
     297                u8.suffix = 0;
     298                BitBlock u8_error = 0;
     299                BitBlock u8_FFFE_FFFF = 0;
     300                BitBlock u8anyscope = 0;
    297301                if (bitblock::any(simd_or(basis_bits.bit_0, carryQ.PabloJCarryTest(0, 10))))
    298302                {
     
    466470                }
    467471                u8.unibyte = simd_not(basis_bits.bit_0);
    468                 u8.suffix = simd<1>::constant<0>();
    469                 BitBlock u8_error = simd<1>::constant<0>();
    470                 BitBlock u8_FFFE_FFFF = simd<1>::constant<0>();
    471                 BitBlock u8anyscope = simd<1>::constant<0>();
     472                u8.suffix = 0;
     473                BitBlock u8_error = 0;
     474                BitBlock u8_FFFE_FFFF = 0;
     475                BitBlock u8anyscope = 0;
    472476                if (bitblock::any(simd_or(basis_bits.bit_0, carryQ.PabloJCarryTest(0, 10))))
    473477                {
     
    552556        IDISA_INLINE void do_block(struct Lex & lex, struct Marker & marker, struct CtCDPI_Callouts & ctCDPI_Callouts, struct Check_streams & check_streams)
    553557        {
    554                 ctCDPI_Callouts.Ct_starts = simd<1>::constant<0>();
    555                 ctCDPI_Callouts.Ct_ends = simd<1>::constant<0>();
    556                 ctCDPI_Callouts.CD_starts = simd<1>::constant<0>();
    557                 ctCDPI_Callouts.CD_ends = simd<1>::constant<0>();
    558                 ctCDPI_Callouts.PI_starts = simd<1>::constant<0>();
    559                 ctCDPI_Callouts.PI_name_starts = simd<1>::constant<0>();
    560                 ctCDPI_Callouts.PI_name_ends = simd<1>::constant<0>();
    561                 ctCDPI_Callouts.PI_ends = simd<1>::constant<0>();
    562                 BitBlock CtCDPI_starts = simd<1>::constant<0>();
    563                 BitBlock CtCDPI_ends = simd<1>::constant<0>();
    564                 BitBlock ctCDPI_mask = simd<1>::constant<0>();
     558                ctCDPI_Callouts.Ct_starts = 0;
     559                ctCDPI_Callouts.Ct_ends = 0;
     560                ctCDPI_Callouts.CD_starts = 0;
     561                ctCDPI_Callouts.CD_ends = 0;
     562                ctCDPI_Callouts.PI_starts = 0;
     563                ctCDPI_Callouts.PI_name_starts = 0;
     564                ctCDPI_Callouts.PI_name_ends = 0;
     565                ctCDPI_Callouts.PI_ends = 0;
     566                BitBlock CtCDPI_starts = 0;
     567                BitBlock CtCDPI_ends = 0;
     568                BitBlock ctCDPI_mask = 0;
    565569                BitBlock v = simd_or(lex.LAngle, lex.Hyphen);
    566570                BitBlock w = simd_or(lex.Hyphen, lex.QMark);
     
    571575                BitBlock CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    572576                BitBlock CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
    573                 BitBlock CD_closer = simd<1>::constant<0>();
     577                BitBlock CD_closer = 0;
    574578                BitBlock DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
    575579                if (bitblock::any(simd_or(lex.RBracket, carryQ.PabloJCarryTest(0, 2))))
     
    719723        void do_final_block(struct Lex & lex, struct Marker & marker, struct CtCDPI_Callouts & ctCDPI_Callouts, struct Check_streams & check_streams, BitBlock & EOF_mask)
    720724        {
    721                 ctCDPI_Callouts.Ct_starts = simd<1>::constant<0>();
    722                 ctCDPI_Callouts.Ct_ends = simd<1>::constant<0>();
    723                 ctCDPI_Callouts.CD_starts = simd<1>::constant<0>();
    724                 ctCDPI_Callouts.CD_ends = simd<1>::constant<0>();
    725                 ctCDPI_Callouts.PI_starts = simd<1>::constant<0>();
    726                 ctCDPI_Callouts.PI_name_starts = simd<1>::constant<0>();
    727                 ctCDPI_Callouts.PI_name_ends = simd<1>::constant<0>();
    728                 ctCDPI_Callouts.PI_ends = simd<1>::constant<0>();
    729                 BitBlock CtCDPI_starts = simd<1>::constant<0>();
    730                 BitBlock CtCDPI_ends = simd<1>::constant<0>();
    731                 BitBlock ctCDPI_mask = simd<1>::constant<0>();
     725                ctCDPI_Callouts.Ct_starts = 0;
     726                ctCDPI_Callouts.Ct_ends = 0;
     727                ctCDPI_Callouts.CD_starts = 0;
     728                ctCDPI_Callouts.CD_ends = 0;
     729                ctCDPI_Callouts.PI_starts = 0;
     730                ctCDPI_Callouts.PI_name_starts = 0;
     731                ctCDPI_Callouts.PI_name_ends = 0;
     732                ctCDPI_Callouts.PI_ends = 0;
     733                BitBlock CtCDPI_starts = 0;
     734                BitBlock CtCDPI_ends = 0;
     735                BitBlock ctCDPI_mask = 0;
    732736                BitBlock v = simd_or(lex.LAngle, lex.Hyphen);
    733737                BitBlock w = simd_or(lex.Hyphen, lex.QMark);
     
    738742                BitBlock CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    739743                BitBlock CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
    740                 BitBlock CD_closer = simd<1>::constant<0>();
     744                BitBlock CD_closer = 0;
    741745                BitBlock DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
    742746                if (bitblock::any(simd_or(lex.RBracket, carryQ.PabloJCarryTest(0, 2))))
     
    895899        IDISA_INLINE void do_block(struct Lex & lex, struct Marker & marker, struct Tag_Callouts & tag_Callouts)
    896900        {
    897                 BitBlock EqExpected = simd<1>::constant<0>();
    898                 BitBlock AttListEnd = simd<1>::constant<0>();
     901                BitBlock EqExpected = 0;
     902                BitBlock AttListEnd = 0;
    899903                BitBlock DQuoteDelim = simd_or(lex.DQuote, lex.LAngle);
    900904                BitBlock SQuoteDelim = simd_or(lex.SQuote, lex.LAngle);
     
    904908                tag_Callouts.ElemName_ends = carryQ.BitBlock_scanthru_ci_co(tag_Callouts.ElemName_starts, lex.NameScan, carryQ.get_carry_in(0), 0);
    905909                BitBlock ParseError = simd_and(tag_Callouts.ElemName_starts, tag_Callouts.ElemName_ends);
    906                 tag_Callouts.AttName_starts = simd<1>::constant<0>();
    907                 tag_Callouts.AttName_ends = simd<1>::constant<0>();
    908                 tag_Callouts.AttVal_starts = simd<1>::constant<0>();
    909                 tag_Callouts.AttVal_ends = simd<1>::constant<0>();
     910                tag_Callouts.AttName_starts = 0;
     911                tag_Callouts.AttName_ends = 0;
     912                tag_Callouts.AttVal_starts = 0;
     913                tag_Callouts.AttVal_ends = 0;
    910914                if (bitblock::any(simd_or(simd_and(tag_Callouts.ElemName_ends, lex.WS), carryQ.PabloJCarryTest(1, 8))))
    911915                {
     
    10271031        void do_final_block(struct Lex & lex, struct Marker & marker, struct Tag_Callouts & tag_Callouts, BitBlock & EOF_mask)
    10281032        {
    1029                 BitBlock EqExpected = simd<1>::constant<0>();
    1030                 BitBlock AttListEnd = simd<1>::constant<0>();
     1033                BitBlock EqExpected = 0;
     1034                BitBlock AttListEnd = 0;
    10311035                BitBlock DQuoteDelim = simd_or(lex.DQuote, lex.LAngle);
    10321036                BitBlock SQuoteDelim = simd_or(lex.SQuote, lex.LAngle);
     
    10361040                tag_Callouts.ElemName_ends = carryQ.BitBlock_scanthru_ci_co(tag_Callouts.ElemName_starts, lex.NameScan, carryQ.get_carry_in(0), 0);
    10371041                BitBlock ParseError = simd_and(tag_Callouts.ElemName_starts, tag_Callouts.ElemName_ends);
    1038                 tag_Callouts.AttName_starts = simd<1>::constant<0>();
    1039                 tag_Callouts.AttName_ends = simd<1>::constant<0>();
    1040                 tag_Callouts.AttVal_starts = simd<1>::constant<0>();
    1041                 tag_Callouts.AttVal_ends = simd<1>::constant<0>();
     1042                tag_Callouts.AttName_starts = 0;
     1043                tag_Callouts.AttName_ends = 0;
     1044                tag_Callouts.AttVal_starts = 0;
     1045                tag_Callouts.AttVal_ends = 0;
    10421046                if (bitblock::any(simd_or(simd_and(tag_Callouts.ElemName_ends, lex.WS), carryQ.PabloJCarryTest(1, 8))))
    10431047                {
     
    11681172        IDISA_INLINE void do_block(struct Lex & lex, struct Marker & marker, struct Ref_Callouts & ref_Callouts)
    11691173        {
    1170                 ref_Callouts.GenRef_starts = simd<1>::constant<0>();
    1171                 ref_Callouts.GenRef_ends = simd<1>::constant<0>();
    1172                 ref_Callouts.DecRef_starts = simd<1>::constant<0>();
    1173                 ref_Callouts.DecRef_ends = simd<1>::constant<0>();
    1174                 ref_Callouts.HexRef_starts = simd<1>::constant<0>();
    1175                 ref_Callouts.HexRef_ends = simd<1>::constant<0>();
    1176                 BitBlock ref_error = simd<1>::constant<0>();
     1174                ref_Callouts.GenRef_starts = 0;
     1175                ref_Callouts.GenRef_ends = 0;
     1176                ref_Callouts.DecRef_starts = 0;
     1177                ref_Callouts.DecRef_ends = 0;
     1178                ref_Callouts.HexRef_starts = 0;
     1179                ref_Callouts.HexRef_ends = 0;
     1180                BitBlock ref_error = 0;
    11771181                if (bitblock::any(simd_or(marker.Ref_opener, carryQ.PabloJCarryTest(0, 6))))
    11781182                {
     
    12051209        void do_final_block(struct Lex & lex, struct Marker & marker, struct Ref_Callouts & ref_Callouts, BitBlock & EOF_mask)
    12061210        {
    1207                 ref_Callouts.GenRef_starts = simd<1>::constant<0>();
    1208                 ref_Callouts.GenRef_ends = simd<1>::constant<0>();
    1209                 ref_Callouts.DecRef_starts = simd<1>::constant<0>();
    1210                 ref_Callouts.DecRef_ends = simd<1>::constant<0>();
    1211                 ref_Callouts.HexRef_starts = simd<1>::constant<0>();
    1212                 ref_Callouts.HexRef_ends = simd<1>::constant<0>();
    1213                 BitBlock ref_error = simd<1>::constant<0>();
     1211                ref_Callouts.GenRef_starts = 0;
     1212                ref_Callouts.GenRef_ends = 0;
     1213                ref_Callouts.DecRef_starts = 0;
     1214                ref_Callouts.DecRef_ends = 0;
     1215                ref_Callouts.HexRef_starts = 0;
     1216                ref_Callouts.HexRef_ends = 0;
     1217                BitBlock ref_error = 0;
    12141218                if (bitblock::any(simd_or(marker.Ref_opener, carryQ.PabloJCarryTest(0, 6))))
    12151219                {
  • proto/pabloj/trunk/src/applicationGenerator/ApplicationGenerator.java

    r2940 r2952  
    2222import java.io.File;
    2323import applicationGenerator.helpers.FileUtil;
    24 import compiler.codeGenerator.visitors.CPPUnparser;
     24import applicationGenerator.parser.Parser;
     25import applicationGenerator.parser.ParserException;
    2526
    26 import compiler.codeGenerator.visitors.Unparser;
    27 import compiler.lang.pabloS.*;
    28 import compiler.lang.carry.*;
    29 import compiler.parser.*;
    30 import compiler.transformers.PabloS2PabloBXFormer;
    31 import compiler.transformers.pabloS.CarryInfoSetVisitor;
    32 import compiler.transformers.pabloS.PabloSTransformer;
    33 import compiler.symbolTable.*;
     27import compilers.pabloB.codeGenerator.visitors.CPPUnparser;
     28import compilers.pabloB.codeGenerator.visitors.Unparser;
     29import compilers.pabloB.lang.carry.CarryBuiltins2CPP;
     30import compilers.pabloB.lang.carry.CarryBuiltins2Lang;
     31import compilers.pabloB.symbols.SymbolTable;
     32import compilers.pabloS.lang.*;
     33import compilers.pabloS.semanticAnalyzer.visitors.CarryInfoSetVisitor;
     34import compilers.pabloS.semanticAnalyzer.visitors.PabloS2PabloBXFormer;
     35import compilers.pabloS.semanticAnalyzer.visitors.PabloSTransformer;
    3436
    3537public class ApplicationGenerator {
     
    5355                // Transformation configurations to support multiple backends
    5456                Builtins2Lang builtins2Lang             = null;
    55                 CarryBuiltins2Lang carrySet2Lang = null;
     57                CarryBuiltins2Lang carrySet2Lang        = null;
    5658                Unparser unparser                                       = null;
    5759               
  • proto/pabloj/trunk/src/applicationGenerator/HeaderTemplateContentsGenerator.java

    r2947 r2952  
    1111
    1212import applicationGenerator.helpers.FileUtil;
    13 import compiler.ast.pabloB.Accessors;
    14 import compiler.codeGenerator.visitors.Unparser;
    15 import compiler.templating.FileTemplate;
    16 import compiler.templating.Template;
     13import applicationGenerator.templating.FileTemplate;
     14import applicationGenerator.templating.Template;
     15import compilers.pabloB.ast.Accessors;
     16import compilers.pabloB.codeGenerator.visitors.Unparser;
    1717
    1818import java.io.File;
  • proto/pabloj/trunk/src/applicationGenerator/TemplateContentsGenerator.java

    r2935 r2952  
    77package applicationGenerator;
    88
    9 import compiler.codeGenerator.visitors.Unparser;
     9import compilers.pabloB.codeGenerator.visitors.Unparser;
    1010
    1111abstract public class TemplateContentsGenerator {
  • proto/pabloj/trunk/src/applicationGenerator/logging/Logger.java

    r2949 r2952  
    1 package compiler.logging;
     1package applicationGenerator.logging;
    22
    33import java.util.HashMap;
    44import java.util.Map;
    55import java.util.logging.Level;
    6 import java.util.logging.Logger;
    76
    87/** This class is a Facade for java.util.logging.
     
    1413 */
    1514
    16 public class PabloJLogger {
    17         private static Map<String, PabloJLogger> JuncoLoggers = new HashMap<String, PabloJLogger>();
     15public class Logger {
     16        private static Map<String, Logger> JuncoLoggers = new HashMap<String, Logger>();
    1817        private static int numMessages = 0;
    1918        private static int maxMessagesBeforeQuit = Integer.MAX_VALUE;
     
    2120        ////////////////////////////////////////////////////////////////
    2221        // static interface
    23         public static PabloJLogger getLogger(String loggerName) {
     22        public static Logger getLogger(String loggerName) {
    2423                if(!JuncoLoggers.containsKey(loggerName)) {
    25                         JuncoLoggers.put(loggerName, new PabloJLogger(loggerName));
     24                        JuncoLoggers.put(loggerName, new Logger(loggerName));
    2625                }
    2726                return JuncoLoggers.get(loggerName);
     
    3736        // per-instance code
    3837        private Logger logger;
    39         private PabloJLogger(String loggerName) {
     38        private Logger(String loggerName) {
    4039                logger = Logger.getLogger(loggerName);
    4140        }
  • proto/pabloj/trunk/src/applicationGenerator/parser/Parser.java

    r2949 r2952  
    66 */
    77
    8 package  compiler.parser;
     8package  applicationGenerator.parser;
    99
     10import applicationGenerator.parser.Parser;
    1011import pabloS.ast.ASTNode;
    1112import pabloS.lexicalAnalyzer.LexicalController;
    1213import pabloS.logging.ScatterLogger;
    13 import compiler.parser.Parser;
    1414
    1515public class Parser {
  • proto/pabloj/trunk/src/applicationGenerator/parser/ParserException.java

    r2949 r2952  
    1 package compiler.parser;
     1package applicationGenerator.parser;
    22
    33public class ParserException extends Exception {
  • proto/pabloj/trunk/src/applicationGenerator/templating/FileTemplate.java

    r2949 r2952  
    1 package compiler.templating;
     1package applicationGenerator.templating;
    22
    33import pabloS.inputHandler.LineBasedReader;
  • proto/pabloj/trunk/src/applicationGenerator/templating/MemoryTemplate.java

    r2949 r2952  
    1 package compiler.templating;
     1package applicationGenerator.templating;
    22
    33import java.io.PrintStream;
  • proto/pabloj/trunk/src/applicationGenerator/templating/Template.java

    r2949 r2952  
    1 package compiler.templating;
     1package applicationGenerator.templating;
    22
    33import java.io.PrintStream;
  • proto/pabloj/trunk/src/compilers/pabloB/lang/Builtins.java

    r2949 r2952  
    1 package compiler.lang.pabloB;
    2 
    3 import java.util.ArrayList;
    4 import java.util.List;
     1package compilers.pabloB.lang;
    52
    63public enum Builtins {
  • proto/pabloj/trunk/src/compilers/pabloB/lang/Builtins2Lang.java

    r2949 r2952  
    1 package compiler.lang.pabloB;
     1package compilers.pabloB.lang;
    22
    33public abstract class Builtins2Lang {
  • proto/pabloj/trunk/src/compilers/pabloS/semanticAnalyzer/SemanticAnalyzer.java

    r2949 r2952  
    1 package compiler.semanticAnalyzer.pabloS;
     1package compilers.pabloS.semanticAnalyzer;
    22
    33public class SemanticAnalyzer {
    4         // TODO
     4
    55}
  • proto/pabloj/trunk/src/test/pabloS/PabloSTestHarness.java

    r2947 r2952  
    1313import  pabloS.logging.ScatterLogger;
    1414
    15 import compiler.test.*;
    16 import compiler.lang.carry.CarryBuiltins2CPP;
    17 import compiler.lang.carry.CarryBuiltins2Lang;
    18 import compiler.lang.pabloS.PabloSBuiltins2CPP;
    19 import compiler.lang.pabloS.Builtins2Lang;
    20 import compiler.lang.pabloS.Builtins;
    21 
    22 import compiler.transformers.pabloS.AdvanceCombinerXFormer;
    23 import compiler.transformers.pabloS.AugAssignXFormer;
    24 import compiler.transformers.pabloS.Bitwise2IDISAXFormer;
    25 import compiler.transformers.pabloS.CarryIntroXFormer;
    26 import compiler.transformers.pabloS.StreamFuncVisitor;
    27 import compiler.transformers.pabloS.helpers.AssertCompare;
     15import compilers.pabloB.lang.carry.CarryBuiltins2CPP;
     16import compilers.pabloB.lang.carry.CarryBuiltins2Lang;
     17import compilers.pabloS.lang.Builtins;
     18import compilers.pabloS.lang.Builtins2Lang;
     19import compilers.pabloS.lang.PabloSBuiltins2CPP;
     20import compilers.pabloS.semanticAnalyzer.helpers.AssertCompare;
     21import compilers.pabloS.semanticAnalyzer.visitors.AdvanceCombinerXFormer;
     22import compilers.pabloS.semanticAnalyzer.visitors.AugAssignXFormer;
     23import compilers.pabloS.semanticAnalyzer.visitors.Bitwise2IDISAXFormer;
     24import compilers.pabloS.semanticAnalyzer.visitors.CarryIntroXFormer;
     25import compilers.pabloS.semanticAnalyzer.visitors.StreamFuncVisitor;
     26import compilers.test.*;
     27
    2828
    2929@SuppressWarnings("unused")
Note: See TracChangeset for help on using the changeset viewer.