$      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ SafeTokenization is 9 except the white space is tagged rather than discarded.#Identifiers, symbols, and constantsWhite space, etc.Extract the contents of a . if the given  is ;  otherwise. if the given  is not ;  otherwise.Return the contents of only  (non-space) tokens.Trim  s from both ends of a list of s.Is a  a newline character? Break a $ into space and non-whitespace runs. If you encounter a string literal, call this helper with a double-barreled continuation and the rest of your input. The continuation will expect the remainder of the string literal as the first argument, and the remaining input as the second argument. splits isDelimiter str tokenizes str using  isDelimiterM as a delimiter predicate. Leading whitespace is also stripped from tokens. Predicate on space characters based on something approximating valid identifier syntax. This is used to break apart non-space characters. Something like 12E+FOO& is a single pre-processor token, so FOO should not be macro expanded.Break an input  into a sequence of Tokensh. Warning: This may not exactly correspond to your target language's definition of a valid identifier!Collapse a sequence of Tokens back into a . detokenize . tokenize == id.    SafeStringification puts double quotes around a string and backslashes before existing double quote characters and backslash characters.9Remove double quote characters from the ends of a string.Trim trailing spaces from a MRemove a suffix of a list all of whose elements satisfy the given predicate.0Similar to the function of the same name in the text package.breakOn needle haystack finds the first instance of needle in haystack6. The first component of the result is the prefix of haystack before needle- is matched. The second is the remainder of haystack, starting with the match.Used to make switching to the text package easier.Safe*OTExpressions are literal values, binary operators applied to two sub-expressions, or unary operators applied to a single sub-expression.For 5https://en.wikipedia.org/wiki/Shunting-yard_algorithm referenceQIf one side of an operator is unsigned, the other side is converted to unsigned.6Precedence of binary operators from lowest to highest.4String literals are split by tokenization. Fix them!]Re-combine positive and negative unary operators with the tokens to which they are attached.(Re-combine multiple-character operators.pRead a literal integer. These may be decimal, octal, or hexadecimal, and may have a case-insensitive suffix of u, l, or ul.LExhaust the function/operator stack returning the parsed expression in RPN.8Shunting yard algorithm part for dealing with operators.IShunting yard to produce a reverse polish notation (RPN) list of tokens.-Convert an RPN list of parsed tokens into an .Try to read an  from a sequence of s.Pretty-print an ` to something semantically equivalent to the original C syntax (some parentheses may be added).All s can be evaluated to an .evalExpr isDefined e evaluates expression eQ in an environment where the existence of macro definitions is captured by the  isDefined+ predicate. All expressions evaluate to an !W      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH !"/      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH !"Safe8An empty binding environment.9Add a  (key,value) pair to an environment.:)Delete an entry from an association list.;Looks up a value in an association list. If the key is found, the value is returned along with an updated association list with that key at the front.89:;89:;89:;89:;Safe<6A fully-populated configuration for the pre-processor.=mPre-processor configuration parameterized over a functor. This is used to normalize partial configurations,  ConfigF Maybe<, and configurations suitable for the pre-processor logic, ConfigF IdentityB. Specifically, the source file name of the file being processed must be set.FA  representing a date.IA  representing a time.L7Ensure that required configuration fields are supplied.M3Extract the current file name from a configuration.N4Extract the include paths name from a configuration.O4Determine if continued long lines should be spliced.P/Determine if C-style comments should be erased.Q;Determine if generation of linemarkers should be inhibited.R&The date the pre-processor was run on.S0The time of the active pre-processor invocation.T6A default configuration with no current file name set.U&Format a date according to the C spec.V&Format a time according to the C spec.WcA default preprocessor configuration with date and time stamps taken from the current system time.<=>?@ABCDEFGHIJKLMNOPQRSTUVW<=>?@ABCDEFGHIJKLMNOPQRSTUVWIJKFGH=>?@ABCDE<LMNOPQRSTUVW<=>?@ABCDEFGHIJKLMNOPQRSTUVWSafe9;[^6There are object-like macros and function-like macros._4An object-like macro is replaced with its definition`A function-like macro of some arity taks macro-expanded and raw versions of its arguments, then substitutes them into a body producing a new set of tokens.aMacro expansion involves treating tokens differently if they appear in the original source for or as the result of a previous macro expansion. This distinction is used to prevent divergence by masking out definitions that could be used recursively.sThings are made somewhat more complicated than one might expect due to the fact that the scope of this masking is not structurally recursive. A object-like macro can expand into a fragment of a macro function application, one of whose arguments is a token matching the original object-like macro. That argument should not be expanded.f=An interpreter capability of threading a binding environment.i2An interpreter capability to modify dynamic state.lAA free monad transformer specialized to HppF as the base functor.ocA free monad construction to strictly delimit what capabilities we need to perform pre-processing.u)Dynamic state of the preprocessor engine.{)Base functor for a free monad transformer~UA cleanup action that is run at most once. To be used as an abstract type with only  and  as interface.%Hpp can raise various parsing errors."Error conditions we may encounter.A macro binding environment. Line numbers are represented as s)Runs an action and replaces it with a nopmkCleanup cleanup returns two things: a ~* value, and an action to neutralize that ~. In this way, the ~ value can be registered with a resource manager so that, in the event of an error, the cleanup action is run, while the neutralizer may be used to ensure that the registered ~ action has no effect if it is run. Typically one would neutralize a registered cleanup action before performing a manual cleanup that subsumes the registered cleanup.D^_`abcdefghijklmnopqrstuvwxyz{|}~6^_`adbcefghijklmnopqrstuvwxyz{}|~D~{|}uvwxyzopqrstlmnijkfghabcde^_`^_`abcdefghijklmnopqrstuvwxyz{|}~ None[A function that produces an output stream that finishes with another such function. Think of the input to this function as coming from upstream, while the closure of the streamed output may be used to thread state.;A stream of steps that never awaits anything from upstream.-A stream of steps in a computational context. Basic pipe.Package a step into a &Yield a value downstream, then finish.)Yield a value then continue with another ."Package a function that returns a  into a .The end of a stream.Feed values downstream.Lift a monadic value into a WA source whose outputs have all been sunk may be run for its effects and return value.Compute the next step of a .3Map a function over the values yielded by a stream.upstream ~> downstreamI composes two streams such that values flow from upstream to downstream.x  y runs x to completion, discards its  value, then becomes y.1Apply a function to the ending value of a stream.+Apply a function to each value in a stream.3Discard all values that do not satisfy a predicate.A combined filter and map.processPrefix src snk is like  except that when snk finishes, the composite  becomes the remaining src.IThis is a left fold over a f with a final step to deal with leftovers represented by whatever state the fold function maintains.CFlatten out chunks of inputs into individual values. The returned ! smuggles the remaining original  in an U constructor, while the flattened source continues on with the "empty" part of the ; step. The upshot is that the value may be used a regular 5, but it can also be swapped back into the original .See  for an explanation.JApply a function to a Chunky' s output.KApply a function to a s input.yThis is something like a composition of an unfold with a fold. We fold the upstream values into some state carried by a !, then unfold that state in the Chunky's output stream.+LMNIJK%LMNIJK9 NoneOT[ A  is a I whose monadic context is a bit of state carrying a source input stream.Run a  with a given input stream.$Lift a monadic action into a Parser.onParserSource proc feeds the  source through proc using . This means that when proc6 finishes, the remaining source continues unmodified.)Waits for a value from upstream. Returns O if upstream is empty. that throws an error with the given message if no more input is available. This may be used to locate where in a processing pipeline input was unexpectedly exhausted.)Push a value back into a parser's source.4Push a stream of values back into a parser's source.`Discard all values until one fails to satisfy a predicate. At that point, the failing value is  d, and the  stream stops.]Echo all values until one fails to satisfy a predicate. At that point, the failing value is  d, and the  stream stops.OThis is rather like a Lens zoom, but quite fragile. The idea is that we run a  on a transformation of the original source. The transformation of the source is responsible for yielding transformed values, and ending  on demand with the rest of the original source. We additionally scoop up any leftover transformed values and prepend them onto the remaining source after inverting the original transformation.Turn a  on individual values into a  on chunks.PP NoneOTQ Extract the  payload from a a.Expand all macros to the end of the current line or until all in-progress macro invocations are complete, whichever comes last.RParse a function application. Arguments are separated by commas, and the application runs until the balanced closing parenthesis. If this is not an application, O is returned.S.Emit the tokens of a single argument. Returns c if this is the final argument in an application (indicated by an unbalanced closing parenthesis.ThKick this off after an opening parenthesis and it will yield every token up to the closing parenthesis.UReturns O if this isn't an application;  Left args if we parsed arguments args%, but there is an arity mismatch; or  Right tokens3 if the function application expanded successfully.V0Trim whitespace from both ends of a sequence of a tokens.WHCollapse internal whitespace to single spaces, and trim trailing space.QXYZRST[U\]VWQXYZRST[U\]VW None[#sourceFile registerCleanup filePath produces a  of lines from file filePathF after registering an action that closes the file using the provided registerCleanup function.Incrementally writes ds to a temporary file. When all input is exhausted, the temporary file is renamed to the supplied ^.CSink a stream with a function evaluated only for its side-effects.Sink a stream to  sink_ = forever awaitZ Simply discards all inputs. This may be used to exhaust a stream solely for its effects. None*IOT['The dynamic capabilities offered by HPP_ Lets us fix HppT's input type to a , whose context is the type we are defining.Read a file as an Hpp action`URead a file available on the search path after the path containing the current file.aThe first component of each pair represents the end of a known trigraph sequence (each trigraph begins with two consecutive question marks ("??"c). The second component is the single-character equivalent that we substitute in for the trigraph.bYields full lines of input. lineStream :: Monad m => Streamer m String String () lineStream = go id where go acc = awaitMaybe (yield (acc [])) (yieldLines acc) yieldLines acc s = case break (== '\n') s of (h,t) -> case t of [] -> go (acc . (h++)) ['\n'] -> encase $ Yield (acc h) (go id) (_:t') -> encase $ Yield (acc h) (yieldLines id t')LIf a line ends with a backslash, it is prepended to the following the line.cDeal with the two-character ##J token pasting/splicing operator. We do so eliminating spaces around the ## operator.d'functionMacro parameters body arguments substitutes  arguments for  parameters in body/ and performs stringification for uses of the #* operator and token concatenation for the ## operator.e1Run a Stream with a configuration for a new file.9Parse the definition of an object-like or function macro.fUReturns everything up to the next newline. The newline character itself is consumed. Register a ~ in a threaded u.gFHandle preprocessor directives (commands prefixed with an octothorpe).hWe want to expand macros in expressions that must be evaluated for conditionals, but we want to take special care when dealing with the meta definedX operator of the expression language that is a predicate on the evaluation environment.i,Take an entire conditional expression (e.g. #if ... #endifE). All the lines of the taken branch are returned, in reverse order.jTTake everything up to the end of this branch, drop all remaining branches (if any).k5Skip to the end of a conditional branch. Returns the l. the token that ends this branch if it is an else or elif, or O, otherwise, and the number of lines skipped.m9Expands an input line producing a stream of output lines.n-Standard CPP settings for processing C files.oMFor Haskell we often want to ignore C-style comments and long line splicing.pBIf we don't have a predefined processor, we build one based on a < value./Run a stream of lines through the preprocessor.8Preprocess the given file producing line by line output."Monad morphism between Hpp and IO.?_qr`staubvwxyz{cd|}~efghijkmnop <_qr`staubvwxyz{cd|}~efghijkmnop NoneOT:Break a string on an equals sign. For example, the string x=y is broken into  [x,"=",y].iIf no space is included between a switch and its argument, break it into two tokens to simplify parsing.-Run Hpp with the given commandline arguments. !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLKMNOPQRSTTUVVWXYZ[\]^_`abcdefghijklmnompqrstuvwwxyz{|}~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX Y Z [ \ ] ^ _ ` a b c d efg h i j k l m n o p q r s tu v w x y h z { | } ~                        d           "hpp-0.3.1.0-2jzYFEarQeR4FlYQJH6WMw Hpp.Tokens Hpp.StringHpp.ExprHpp.Env Hpp.Config Hpp.Types Hpp.Streamer Hpp.Parser Hpp.Expansion Hpp.StreamIOHpp Hpp.CmdLine System.IOstdoutToken ImportantOtherdetok isImportant notImportant importantstrimUnimportantnewLinetokWords skipLiteralsplitsvalidIdentifierChar fixExponentstokenize detokenize $fEqToken $fOrdToken $fShowToken stringifyunquote trimSpacesbreakOnconsExprELitEBinOpEUnaryOp readLitInt parseExpr renderExprevalExpr $fNumCppInt $fOrdCppInt $fEqCppInt $fEqBinOp $fOrdBinOp $fShowBinOp $fEqUnaryOp $fOrdUnaryOp $fShowUnaryOp$fEqLit$fOrdLit $fShowLit $fEqParsed $fOrdParsed $fShowParsed $fEqAssoc $fOrdAssoc $fShowAssoc $fEqFunLike $fOrdFunLike $fShowFunLike$fEqExpr $fOrdExpr $fShowExpremptyEnv insertPair deleteKey lookupKeyConfigConfigF curFileNameF includePathsFspliceLongLinesFeraseCCommentsFinhibitLinemarkersF prepDateF prepTimeF DateString getDateString TimeString getTimeString realizeConfig curFileName includePathsspliceLongLineseraseCCommentsinhibitLinemarkersprepDateprepTimedefaultConfigFformatPrepDateformatPrepTimedefaultConfigFNow$fEqTimeString$fOrdTimeString$fShowTimeString$fEqDateString$fOrdDateString$fShowDateStringMacroObjectFunctionScanUnmaskMaskRescanHasEnvgetEnvsetEnv HasHppStategetStatesetStateHppTrunHppTHppFReadFileReadNextGetStateSetState ThrowErrorHppState hppConfig hppLineNum hppCleanupshppEnvFreeFPureFCleanupHasError throwErrorErrorUnterminatedBranchBadMacroDefinitionBadIfPredicateBadLineArgumentIncludeDoesNotExist FailedInclude UserErrorUnknownCommandTooFewArgumentsToMacroBadMacroArguments NoInputFileBadCommandLine RanOutOfInputEnvLineNum runCleanup mkCleanup $fShowMacro$fHasEnvExceptT$fHasErrorHppT $fHasEnvHppT$fHasHppStateHppT $fMonadIOHppT$fMonadTransHppT $fMonadHppT$fApplicativeHppT $fFunctorHppT $fFunctorHppF$fFunctorFreeF$fHasHppStateExceptT$fHasErrorExceptT $fEqError $fOrdError $fShowError$fEqScan $fShowScanChunkySourceStreamer runStream StreamStepAwaitYieldDoneencaseyieldyieldsawaitsdonesourceliftSrun nextOutput mapStream~>beforeonDonemapping filtering mappingMaybe processPrefix flattenTilmapTil metamorph$fHasEnvStreamer$fHasHppStateStreamer$fHasErrorStreamer$fAlternativeStreamer$fApplicativeStreamer$fFunctorStreamer$fFunctorStreamStepParser runParserparseliftPonParserSourceawaitP awaitJustreplaceprecede droppingWhile takingWhile zoomParsezoomParseChunks$fMonadIOParser$fHasHppStateParser$fHasErrorParser$fAlternativeParser $fMonadParser$fApplicativeParser$fFunctorParser expandLine sourceFile sinkToFilesinkTell sinkToStdOutsink_HppCaps hppReadFileparseDefinitionhppRegisterCleanup preprocess streamHpphppIO$fHasHppFileIOHppStream$fFunctorHppStream$fApplicativeHppStream$fMonadHppStream$fMonadIOHppStream$fHasHppStateHppStream$fHasErrorHppStream$fHasEnvHppStream runWithArgsbase Data.OldListwordsghc-prim GHC.TypesTrueFalseGHC.BaseStringtrimEndFunLikeCppInt precedenceBin fixStringLits fixUnaryOps fixBinaryOpsfinishShunting juggleBinOpsshuntRPN rpnToExprInt evalExpr'FunBinFunUnaryFunParenAssoc RightLeft LeftRight getCppIntParsedPBinOpPUnaryOpPLitLitLitIntLitUIntLitStrLitCharLitIDUnaryOpNegBitNotNotDefinedBinOpAddSubMulDivModBitAndBitOrBitXorShiftLShiftRLessThan GreaterThanEqualTo NotEqualToGreaterOrEqualTo LessOrEqualToAndOr onCommonType onCommonTypeB integralCppbitsCpp cppShiftL cppShiftR cppComplement associativity precedenceonFirstImportant renderBinOp renderUnaryOplexExpr parseUnaryOp parseBinOpparseOp readWideCharreadNarrowCharparseLitdigitsFromBase readLitInt'opParsedopFuncommonchunkMap chunkConmap _feedStreamer predicateMapmaybeNotNothingParserRunscanappParseargParse parentheticalexpandFunctiontrimScan trimScanAux isSpaceScanisImportantScan expandLine'argError lookupEnv expandMacroGHC.IOFilePath HppStream hppReadNext trigraphs lineSplicingprepTokenSplices functionMacro streamNewFiletakeLine directive squashDefinestakeConditional takeBranch dropBranchJustmacroExpansion normalCPP haskellCPP genericConfig HasHppFileIO InputStreamLenstrigraphReplacementbreakBlockCommentStartbreakBlockCommentEnddropOneLineBlockCommentsdropLineCommentsremoveMultilineCommentscommentRemovalconfiglineNumcleanupsenv modifyStateincludeCandidatessearchForIncludesearchForNextIncluderunHppdropLinesetLgetLover emptyHppStategetL'setL'over' expandLinePincLinegetCmddroppingSpaces yieldLineNumdropAllBranchesdropBranchLineparseStreamHpp prepareInputbreakEqs splitSwitches parseArgs