tools/pas2c/Pas2C.hs
changeset 14357 3baee596a989
parent 14237 81fba21495a5
child 15750 036263d63b05
equal deleted inserted replaced
14356:c2712b142e9d 14357:3baee596a989
   237 pascal2C (Unit _ interface implementation _ _) =
   237 pascal2C (Unit _ interface implementation _ _) =
   238     liftM2 ($+$) (interface2C interface True) (implementation2C implementation)
   238     liftM2 ($+$) (interface2C interface True) (implementation2C implementation)
   239 
   239 
   240 pascal2C (Program _ implementation mainFunction) = do
   240 pascal2C (Program _ implementation mainFunction) = do
   241     impl <- implementation2C implementation
   241     impl <- implementation2C implementation
   242     [main] <- tvar2C True False True True 
   242     main <- liftM head $ tvar2C True False True True
   243         (FunctionDeclaration (Identifier "main" (BTInt True)) False False False (SimpleType $ Identifier "int" (BTInt True)) 
   243         (FunctionDeclaration (Identifier "main" (BTInt True)) False False False (SimpleType $ Identifier "int" (BTInt True)) 
   244             [VarDeclaration False False ([Identifier "argc" (BTInt True)], SimpleType (Identifier "Integer" (BTInt True))) Nothing
   244             [VarDeclaration False False ([Identifier "argc" (BTInt True)], SimpleType (Identifier "Integer" (BTInt True))) Nothing
   245             , VarDeclaration False False ([Identifier "argv" BTUnknown], SimpleType (Identifier "PPChar" BTUnknown)) Nothing] 
   245             , VarDeclaration False False ([Identifier "argv" BTUnknown], SimpleType (Identifier "PPChar" BTUnknown)) Nothing] 
   246         (Just (TypesAndVars [], Phrases [mainResultInit, mainFunction])))
   246         (Just (TypesAndVars [], Phrases [mainResultInit, mainFunction])))
   247 
   247