tools/pas2c/PascalParser.hs
changeset 10245 3ccc054c3c3e
parent 10131 4b4a043111f4
child 10353 25f325b48a6c
equal deleted inserted replaced
10244:f7b5b4b88171 10245:3ccc054c3c3e
     1 module PascalParser (
     1 module PascalParser (
     2     pascalUnit
     2     pascalUnit,
       
     3     mainResultInit
     3     )
     4     )
     4     where
     5     where
     5 
     6 
     6 import Text.Parsec
     7 import Text.Parsec
     7 import Text.Parsec.Token
     8 import Text.Parsec.Token
    10 import Data.Maybe
    11 import Data.Maybe
    11 import Data.Char
    12 import Data.Char
    12 
    13 
    13 import PascalBasics
    14 import PascalBasics
    14 import PascalUnitSyntaxTree
    15 import PascalUnitSyntaxTree
       
    16 
       
    17 
       
    18 mainResultInit :: Phrase
       
    19 mainResultInit = (\(Right a) -> a) $ parse phrase "<built-in>" "main:= 0;"
    15 
    20 
    16 knownTypes :: [String]
    21 knownTypes :: [String]
    17 knownTypes = ["shortstring", "ansistring", "char", "byte"]
    22 knownTypes = ["shortstring", "ansistring", "char", "byte"]
    18 
    23 
    19 pascalUnit :: Parsec String u PascalUnit
    24 pascalUnit :: Parsec String u PascalUnit