rearranged some functions,

added check for multiple definitions
changed naming of attributes in haskell
This commit is contained in:
Macocian Adrian Radu
2022-02-24 12:05:53 +01:00
parent a84f433667
commit edee037aa3
7 changed files with 58 additions and 27 deletions

View File

@@ -33,6 +33,12 @@ main = do
args <- getArgs
let mainFile = head args
parseResult <- parseWithImport mainFile
--Start
let maps = fstlst parseResult
let funcs = concat $ sndlst maps
print funcs
--END
let checked = checkObjects parseResult
let headers = fstlst checked
let objects = nestedRights $ sndlst checked
@@ -59,7 +65,8 @@ parseWithImport file =
let importedTypes = concat $ fstlst importedSymbolTable
let importedFunctions = concat $ sndlst importedSymbolTable
let definedTypes = addNewTypes importedTypes objs
let definedFunctions = addNewFunctions (definedTypes, importedFunctions) objs
let definedFunctions = addNewFunctions (definedTypes, importedFunctions) objs
let _ = last definedFunctions
return $ ((definedTypes, definedFunctions), (MakeHeader name desc vers imp, objs)) : concat imports
-- |Parse a file into a list of RosettaObjects