summaryrefslogtreecommitdiff
path: root/faq.texi
diff options
context:
space:
mode:
authorWill Estes <wlestes@users.sourceforge.net>2002-08-07 17:23:08 +0000
committerWill Estes <wlestes@users.sourceforge.net>2002-08-07 17:23:08 +0000
commitb0f62c85f1cdc087877bf1520acb25301ee71282 (patch)
tree8c6317480e1b1d655f85fb138dc755733dde39a9 /faq.texi
parent9814d3ee511a8606cbca155488a0ceba7f414b36 (diff)
proofed "How do I expand \ escape sequences in C-style quoted strings?"
Diffstat (limited to 'faq.texi')
-rw-r--r--faq.texi12
1 files changed, 5 insertions, 7 deletions
diff --git a/faq.texi b/faq.texi
index 37a91c8..6f000ff 100644
--- a/faq.texi
+++ b/faq.texi
@@ -144,26 +144,24 @@ the @cite{Software Tools} lex project from Jef Poskanzer in 1982. At that point
was written in Ratfor. Around 1987 or so, Paxson translated it into C, and
a legend was born :-).
-@node How do I expand \ escape sequences in C-style quoted strings?
+@node How do I expand \ escape sequences in C-style quoted strings?
@unnumberedsec How do I expand \ escape sequences in C-style quoted strings?
-How do I expand \ escape sequences in C-style quoted strings?
-
A key point when scanning quoted strings is that you cannot (easily) write
a single rule that will precisely match the string if you allow things
like embedded escape sequences and newlines. If you try to match strings
with a single rule then you'll wind up having to rescan the string anyway
to find any escape sequences.
-Instead you use exclusive start conditions and a set of rules, one for
+Instead you can use exclusive start conditions and a set of rules, one for
matching non-escaped text, one for matching a single escape, one for
matching an embedded newline, and one for recognizing the end of the
string. Each of these rules is then faced with the question of where to
put its intermediary results. The best solution is for the rules to
-append their local value of yytext to the end of a ``string literal''
+append their local value of @code{yytext} to the end of a ``string literal''
buffer. A rule like the escape-matcher will append to the buffer the
-meaning of the escape sequence rather than the literal text in yytext.
-In this way, yytext does not need to be modified at all.
+meaning of the escape sequence rather than the literal text in @code{yytext}.
+In this way, @code{yytext} does not need to be modified at all.
@node Why do flex scanners call fileno if it is not ANSI compatible?
@unnumberedsec Why do flex scanners call fileno if it is not ANSI compatible?