sdf2p1-parser-0.1.1: A parser for SDF version 2.1 using Parsec

Safe HaskellSafe-Inferred
LanguageHaskell98

Text.SDF.V2p1.Parser.SDFParser

Synopsis

Documentation

sdflang :: GenLanguageDef SdfString a Identity Source

Language definition for the SDF file format Note that the input stream is specialized for the SdfString type so that we can easily change the stream type in one single place

parseSdf :: FilePath -> SdfString -> DelayFile Source

This is a convenience function used to parse a SDF file and return the AST representation of the SDF file.

maybeParser :: Parser a -> Parser (Maybe a) Source

Given a parser, attempt to parse. If parser succeeds, returns a Just value, else Nothing is returned.

sdf_simple :: String -> Parser a -> Parser a Source

Since the format (FOO ...) occurs so often in SDF syntax, the parser sdf_simple is a short cut version for this parser

rtriple_or_rnumber :: Parser Rtriple Source

Parses a rtriple or a rnumber Here we take a shortcut in the data representation, where an rnumber is represented as an rtriple of the same value

posOrNegPair :: String -> String -> Parser ((Rnumber, Maybe Rnumber), (Rnumber, Maybe Rnumber)) Source

Parses a posPair or a negPair name1 and name2 is the edge name, ie. posedge or negedge

sign :: Parser String Source

Parses the negative sign -, or the positive + Absence of sign implies positive

identifier' :: Parser Identifier Source

This is the identifier defined in the SDF spec, but the parser does not consume trailing white spaces (ie. wrapped in a lexeme) as other parsers do. We keep this version of the parser so that we can combine it with hchar parser later to form path parser