Changeset 3599


Ignore:
Timestamp:
Dec 29, 2013, 1:48:22 PM (5 years ago)
Author:
cameron
Message:

Haskell prototype interpreter and regular expression simulator

Location:
proto/RE
Files:
2 added
1 edited
3 moved

Legend:

Unmodified
Added
Removed
  • proto/RE/Haskell/CanonicalRE.hs

    r3598 r3599  
    1111import qualified RE_Proto as Proto
    1212import Data.Char
     13import RunPablo
    1314
    1415data RepLimit = UpperBound Int | Unbounded deriving Show
     
    7576
    7677
    77 --
    78 -- Regular Expression Compiler
    79 
    80 data PabloE = All(Int) | Var(String) | And(PabloE, PabloE) | Or(PabloE, PabloE) | Not(PabloE)
    81               | CharClass(String) | Advance(PabloE) | MatchStar(PabloE, PabloE)
    82    deriving Show
    83 
    84 data PabloS = Assign(String, PabloE) |  If (PabloE, [PabloS])| While (PabloE, [PabloS])
    85    deriving Show
    86 
    87 
    8878--
    8979-- The Symbol Environment keeps track of the symbols generated
     
    226216   cg1_state = re2pablo_helper(r, cg_state)
    227217
     218---------------
     219
     220searchRE :: (RE, String) -> PabloVal
     221searchRE(regexp, str) = evalPabloS(compiled, marker, str)
     222  where (e, compiled, marker) = compile(regexp)
     223       
  • proto/RE/output/demo1src/Makefile

    r3580 r3599  
    1515opt-re: $(SRCFILE)
    1616        clang++ $(CFLAGS) -emit-llvm -c -o llvm-$(OUTFILE).bc $(SRCFILE) $(INCLUDES)
    17         opt-3.4 llvm-$(OUTFILE).bc -o opt-$(OUTFILE).bc  -std-compile-opts
    18         llc-3.4  -filetype=obj  opt-$(OUTFILE).bc  -o  opt-$(OUTFILE).o
     17        llc-3.4  -filetype=obj  llvm-$(OUTFILE).bc  -o  opt-$(OUTFILE).o
    1918        clang++ opt-$(OUTFILE).o -o opt-$(OUTFILE)
    2019
Note: See TracChangeset for help on using the changeset viewer.