paser-tools: doc clarifications
Nothing in the docs said that `parser-tools/yacc' is for LALR grammars --- although I guess that it implied for most reader by the name "yacc", but it doesn't hurt to say so explicitly. Meanwhile, `parser-tools/cfg-parser' is useful for non-ambigious (non-LALR) grammars. Also, from the style guide: * Section Titles Should be In Titlecase, Like This * Don't start a setence with an uncapitalized identifier.
This commit is contained in:
parent
780fc2100a
commit
9e0fce224b
|
@ -486,7 +486,7 @@ the right choice when using @racket[lexer] in other situations.
|
||||||
|
|
||||||
@; ----------------------------------------------------------------------
|
@; ----------------------------------------------------------------------
|
||||||
|
|
||||||
@section{Parsers}
|
@section{LALR(1) Parsers}
|
||||||
|
|
||||||
@section-index["yacc"]
|
@section-index["yacc"]
|
||||||
|
|
||||||
|
@ -685,14 +685,13 @@ the right choice when using @racket[lexer] in other situations.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section{Ambiguous parsing}
|
@section{Context-Free Parsers}
|
||||||
|
|
||||||
@section-index["cfg-parser"]
|
@section-index["cfg-parser"]
|
||||||
|
|
||||||
@defmodule[parser-tools/cfg-parser]
|
@defmodule[parser-tools/cfg-parser]{The @racketmodname[parser-tools/cfg-parser]
|
||||||
|
library provides a parser generator that is an alternative to that of
|
||||||
@racketmodname[parser-tools/cfg-parser] provides another parser
|
@racketmodname[parser-tools/yacc].}
|
||||||
generator as an alternative to @racketmodname[parser-tools/yacc].
|
|
||||||
|
|
||||||
@defform/subs[#:literals (grammar tokens start end precs src-pos
|
@defform/subs[#:literals (grammar tokens start end precs src-pos
|
||||||
suppress debug yacc-output prec)
|
suppress debug yacc-output prec)
|
||||||
|
@ -706,10 +705,11 @@ generator as an alternative to @racketmodname[parser-tools/yacc].
|
||||||
(end token-id ...)
|
(end token-id ...)
|
||||||
(@#,racketidfont{error} expr)
|
(@#,racketidfont{error} expr)
|
||||||
(src-pos)])]{
|
(src-pos)])]{
|
||||||
|
|
||||||
Creates a parser similar to that of @racket[parser]. Unlike @racket[parser],
|
Creates a parser similar to that of @racket[parser]. Unlike @racket[parser],
|
||||||
@racket[cfg-parser] can consume ambiguous grammars.
|
@racket[cfg-parser], can consume arbitrary and potentially ambiguous context-free
|
||||||
Its interface is a subset of @racketmodname[parser-tools/yacc].
|
grammars. Its interface is a subset of @racketmodname[parser-tools/yacc], with
|
||||||
The major differences in the interface are:
|
the following differences:
|
||||||
|
|
||||||
@itemize[
|
@itemize[
|
||||||
|
|
||||||
|
@ -718,12 +718,11 @@ generator as an alternative to @racketmodname[parser-tools/yacc].
|
||||||
Unlike @racket[parser], @racket[cfg-parser] only allows for
|
Unlike @racket[parser], @racket[cfg-parser] only allows for
|
||||||
a single non-terminal-id.}
|
a single non-terminal-id.}
|
||||||
|
|
||||||
@item{@racket[cfg-parser] does not support the @racket[precs],
|
@item{The @racket[cfg-parser] form does not support the @racket[precs],
|
||||||
@racket[suppress], @racket[debug], or @racket[yacc-output]
|
@racket[suppress], @racket[debug], or @racket[yacc-output]
|
||||||
options of @racket[parser].}
|
options of @racket[parser].}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@; ----------------------------------------------------------------------
|
@; ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user