Created
February 1, 2013 07:38
-
-
Save PollRobots/4689946 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec codeGen (b:StringBuilder) i = function | |
| Terminal x -> ibprintf b i """matchTerminal "%s" input offset""" <| escape x | |
| TerminalOneOf x -> ibprintf b i """matchTerminalOneOf "%s" input offset""" <| escape x | |
| TerminalWildcard -> ibprintf b i """matchTerminalWildcard input offset""" | |
| TerminalUnicode x -> ibprintf b i """matchTerminalUnicode System.Globalization.UnicodeCategory.%s input offset""" <| string(x) | |
| Epsilon -> ibprintf b i """if offset = input.Length then (EmptyMatch, offset) else (Unmatched, offset)""" | |
| NonTerminal x -> ibprintf b i """matchRule%s input offset""" <| capitalIdentifier x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment