Macaulay2 » Documentation
Packages » Parsing » Parser : Analyzer
next | previous | forward | backward | up | index | toc

# Parser : Analyzer -- combine a parser with a lexical analyzer to make a complete system

- Operator: :
- Usage:
    `m = p : a`
- Inputs:
  - p, a parser
  - a, a lexical analyzer
- Outputs:
  - m, a function, a function that will provide its argument to a for lexical analysis and will send the resulting stream of tokens through p for parsing. Appropriate error messages are printed as necessary.

## Description

    i1 : (ZZParser : charAnalyzer) "123456789"

    o1 = 123456789

    i2 : (constParser "abc" : charAnalyzer) "abc"

    o2 = abc

## See also

- ZZParser -- a parser that accepts (and returns) an integer, one character at a time
- constParser -- produce a parser that accepts a fixed string, one character at a time
- charAnalyzer -- a lexical analyzer that provides characters from a string one at a time
- Parser : Analyzer -- combine a parser with a lexical analyzer to make a complete system

## Ways to use this method:

- Parser : Analyzer -- combine a parser with a lexical analyzer to make a complete system

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Parsing.m2:260:0.