Changeset 13048
- Timestamp:
- 09/05/06 21:56:10 (2 years ago)
- Location:
- misc/pX/Common/P5_to_P6_Translation
- Files:
-
- 2 modified
-
ASTParser.hs (modified) (1 diff)
-
ASTTranslate-sage.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
misc/pX/Common/P5_to_P6_Translation/ASTParser.hs
r12536 r13048 186 186 printTree outFile (AbstractNode atype []) options = if (and [(atype=="UnknownAbs"),('u' `elem` options)]) then do{ hPutStr outFile "UnknownAbs"; putStrLn "UNKNOWN: UnknownAbs"; hPutStr outFile ""} else (hPutStr outFile "") 187 187 printTree outFile (AbstractNode atype kids) options = if (and [(atype=="UnknownAbs"),('u' `elem` options)]) then do{ hPutStr outFile "UnknownAbs"; putStrLn "UNKNOWN: UnknownAbs"; printTree outFile (head kids) options; printTree outFile (AbstractNode "P5AST" (tail kids)) options} else do{ printTree outFile (head kids) options; printTree outFile (AbstractNode "P5AST" (tail kids)) options} 188 printTree outFile (Heredoc doc start end kids) options = do printTree outFile start options189 hPutStr outFile " ;\n"190 printTree outFile (AbstractNode "P5AST" kids) options 191 printTree outFile end options 188 printTree outFile (Heredoc doc start end kids) options = do{ printTree outFile start options; 189 hPutStr outFile "\n"; 190 printTree outFile (AbstractNode "P5AST" kids) options; 191 printTree outFile end options} 192 192 -
misc/pX/Common/P5_to_P6_Translation/ASTTranslate-sage.hs
r12541 r13048 884 884 getModifiers :: [String] -> String 885 885 getModifiers [] = " " 886 getModifiers args = case (head args) of 887 "-Oo" -> ('o':(getModifiers (drop 1 args))) 888 "-V" -> ('v':(getModifiers (drop 1 args))) 889 "-U" -> ('u':(getModifiers (drop 1 args))) 890 "-R" -> ('r':(getModifiers (drop 1 args))) 891 "-N" -> ('n':(getModifiers (drop 1 args))) 892 "-S" -> ('s':(getModifiers (drop 1 args))) 893 _ -> (' ':(getModifiers (drop 1 args))) 886 getModifiers args = if ((head (head args))=='-') then (multiMods (head args))++(getModifiers (drop 1 args)) else (getModifiers (drop 1 args)) 887 888 multiMods :: String -> String 889 multiMods [] = " " 890 multiMods mods = case (head mods) of 891 'O' -> 'o':(multiMods (tail mods)) 892 'U' -> 'u':(multiMods (tail mods)) 893 'V' -> 'v':(multiMods (tail mods)) 894 'S' -> 's':(multiMods (tail mods)) 895 'R' -> 'r':(multiMods (tail mods)) 896 'N' -> 'n':(multiMods (tail mods)) 894 897 895 898
