Parsing Patterns

Context:

You're writing a program. The standard mode of interaction with devices is piecemeal data entry (e.g. typing in a textfield). But, occasionally, you need to get a large amount of formatted information in one chunck (from a database, from a file, over the wire, ...).

Problem:

You're going to need to parse that information. Sometimes a database access layer has the parsing built in (and gives you some type of ValueObject). But files, and over the wire streams, need to be interpreted.

Forces:

You've never written an explicit piece of parsing code before. It's been years since you opened your copy of the dragon book and you find string processing languages (AWK, PERL, Snobol etcetera) incredibly obscure

Solution:

Use the parsing patterns.

Related Patterns:

ParseUsingGrammars, AlwaysBuildaParseTree?, VisitTheParseTree, LexersRecognizeTokens?, KeepTheBnfReadable?, SplitTheProduction?


EditText of this page (last edited October 28, 2000) or FindPage with title or text search