亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tply.tex

?? YACC和LEX的資料書籍 以及一些源碼 很有幫助
?? TEX
?? 第 1 頁 / 共 5 頁
字號:

\documentstyle[twocolumn]{article}

\title{TP Lex and Yacc -- The Compiler Writer's Tools for Turbo Pascal\\
       Version 3.0 User Manual}

\author{Albert Graef\\
        Schillerstr. 18\\
        6509 Schornsheim\\
        \\
        ag@muwinfa.geschichte.uni-mainz.de}

\date{June 17, 1991}

\setlength{\topmargin}{0cm}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{0cm}
\setlength{\textwidth}{16cm}
\setlength{\textheight}{21cm}
%\setlength{\parindent}{0pt}
\parskip=4pt plus 1pt minus 1pt
\itemsep=0pt
\renewcommand{\baselinestretch}{1.1}
\unitlength=1mm
%\tolerance=500
%\parskip=0.1cm
\leftmargini 1.5em
\leftmarginii 1.5em \leftmarginiii 1.5em \leftmarginiv 1.5em \leftmarginv 1.5em
\leftmarginvi 1.5em

\begin{document}

\maketitle

\section{Introduction}

This document describes the TP Lex and Yacc compiler generator toolset.
These tools are designed especially to help you prepare compilers and
similar programs like text processing utilities and command language
interpreters with the Turbo Pascal (TM) programming language.

TP Lex and Yacc are Turbo Pascal adaptions of the well-known UNIX (TM)
utilities Lex and Yacc, which were written by M.E. Lesk and S.C. Johnson
at Bell Laboratories, and are used with the C programming language. TP Lex
and Yacc are intended to be approximately ``compatible'' with these programs.
However, they are an independent development of the author, based on the
techniques described in the famous ``dragon book'' of Aho, Sethi and Ullman
(Aho, Sethi, Ullman: {\em Compilers : principles, techniques and tools,\/}
Reading (Mass.), Addison-Wesley, 1986).

TP Lex and Yacc, like any other tools of this kind, are not intended for
novices or casual programmers; they require extensive programming experience
as well as a thorough understanding of the principles of parser design and
implementation to be put to work successfully. But if you are a seasoned
Turbo Pascal programmer with some background in compiler design and formal
language theory, you will almost certainly find TP Lex and Yacc to be a
powerful extension of your Turbo Pascal toolset.

This manual tells you how to get started with the TP Lex and Yacc programs
and provides a short description of these programs. Some knowledge about
the C versions of Lex and Yacc will be useful, although not strictly
necessary. For further reading, you may also refer to:

\begin{itemize}
   \item
      Aho, Sethi and Ullman: {\em Compilers : principles, techniques and
      tools.\/} Reading (Mass.), Addison-Wesley, 1986.
   \item
      Johnson, S.C.: {\em Yacc -- yet another compiler-compiler.\/} CSTR-32,
      Bell Telephone Laboratories, 1974.
   \item
      Lesk, M.E.: {\em Lex -- a lexical analyser generator.\/} CSTR-39, Bell
      Telephone Laboratories, 1975.
   \item
      Schreiner, Friedman: {\em Introduction to compiler construction with
      UNIX.\/} Prentice-Hall, 1985.
   \item
      The Unix Programmer's Manual, Sections `Lex' and `Yacc'.
\end{itemize}


\subsection*{Getting Started}

The TP Lex and Yacc programs run on IBM PC compatible computers with
MS-DOS 3.0 (or later) and Turbo Pascal compiler (Version 4.0 or later). Your
system should have at least 512 KB RAM; a hard disk is recommended, while
not strictly necessary.

To install TP Lex and Yacc on your system, simply copy the files on the
distribution disk to an appropriate directory on your hard disk. Then
put this directory on your DOS \verb"PATH" and Turbo Pascal's unit search path
(such that the Turbo Pascal compiler finds the TP Lex and Yacc library
units).

The library units (\verb".TPU" files) in the distribution are compiled with
Turbo Pascal 6.0. If you are using a different Turbo Pascal version,
you will have to recompile these units (sources are provided in the
corresponding \verb"LEXLIB.PAS" and \verb"YACCLIB.PAS" files).

Having installed TP Lex and Yacc on your system, you can now compile
your first TP Lex and Yacc program \verb"EXPR". \verb"EXPR" is a simple
desktop calculator program which consists of a lexical analyzer in the TP Lex
source file \verb"EXPRLEX.L" and the parser and main program in the TP Yacc
source file \verb"EXPR.Y". To compile these programs, issue the commands
\begin{quote}\begin{verbatim}
   lex exprlex
   yacc expr
\end{verbatim}\end{quote}

That's it! You now have the Turbo Pascal sources (\verb"EXPRLEX.PAS" and
\verb"EXPR.PAS") for the \verb"EXPR" program. Use the Turbo Pascal compiler
to compile these programs as follows:
\begin{quote}\begin{verbatim}
   tpc expr
\end{verbatim}\end{quote}

You can now execute the \verb"EXPR" program and type some expressions to see
it work (terminate the program with an empty line). There is a number of other
sample TP Lex and Yacc programs (\verb".L" and \verb".Y" files) on the
distribution disk, including a TP Yacc cross reference utility and a complete
parser for Standard Pascal.

The TP Lex and Yacc programs recognize some options which may be specified
anywhere on the command line. E.g.,
\begin{quote}\begin{verbatim}
   lex /o exprlex
\end{verbatim}\end{quote}
runs TP Lex with ``DFA optimization'' and
\begin{quote}\begin{verbatim}
   yacc /v expr
\end{verbatim}\end{quote}
runs TP Yacc in ``verbose'' mode (TP Yacc generates a readable description
of the generated parser).

The TP Lex and Yacc programs use the following default filename extensions:
\begin{itemize}
   \item \verb".L": TP Lex input files
   \item \verb".Y": TP Yacc input files
   \item \verb".PAS": TP Lex and Yacc output files
\end{itemize}

As usual, you may overwrite default filename extensions by explicitly
specifying suffixes.

If you ever forget how to run TP Lex and Yacc, you can issue the command
\begin{quote}\begin{verbatim}
   lex
\end{verbatim}\end{quote}
or
\begin{quote}\begin{verbatim}
   yacc
\end{verbatim}\end{quote}
without arguments to get a short summary of the command line syntax.

\section{TP Lex}

This section describes the TP Lex lexical analyzer generator.

\subsection*{Usage}

\begin{quote}\begin{verbatim}
LEX [options] lex-file[.L]
  [output-file[.PAS]]
\end{verbatim}\end{quote}

\subsection*{Options}

\begin{description}
   \item[\verb"/v"]
      ``Verbose:'' Lex generates a readable description of the generated
      lexical analyzer, written to lex-file with new extension \verb".LST".
   \item[\verb"/o"]
      ``Optimize:'' Lex optimizes DFA tables to produce a minimal DFA.
\end{description}

\subsection*{Description}

TP Lex is a program generator that is used to generate the Turbo Pascal
source code for a lexical analyzer subroutine from the specification
of an input language by a regular expression grammar.

TP Lex parses the source grammar contained in \verb"lex-file" (with default
suffix \verb".L") and writes the constructed lexical analyzer subroutine
to the specified \verb"output-file" (with default suffix \verb".PAS"); if no
output file is specified, output goes to \verb"lex-file" with new suffix
\verb".PAS." If any errors are found during compilation, error messages are
written to the list file (\verb"lex-file" with new suffix \verb".LST").

The generated output file contains a lexical analyzer routine, \verb"yylex",
implemented as:
\begin{quote}\begin{verbatim}
   function yylex : Integer;
\end{verbatim}\end{quote}

This routine has to be called by your main program to execute the lexical
analyzer. The return value of the \verb"yylex" routine usually denotes the
number of a token recognized by the lexical analyzer (see the \verb"return"
routine in the \verb"LexLib" unit). At end-of-file the \verb"yylex" routine
normally returns \verb"0".

The code template for the \verb"yylex" routine may be found in the
\verb"YYLEX.COD" file. This file is needed by TP Lex when it constructs the
output file. It must be present either in the current directory or in the
directory from which TP Lex was executed (TP Lex searches these directories in
the indicated order).

The TP Lex library (\verb"LexLib") unit is required by programs using
Lex-generated lexical analyzers; you will therefore have to put an appropriate
\verb"uses" clause into your program or unit that contains the lexical
analyzer routine. The \verb"LexLib" unit also provides various useful utility
routines; see the file \verb"LEXLIB.PAS" for further information.

\subsection*{Lex Source}

A TP Lex program consists of three sections separated with the \verb"%%"
delimiter:

\begin{quote}\begin{verbatim}
definitions
%%
rules
%%
auxiliary procedures
\end{verbatim}\end{quote}

All sections may be empty. The TP Lex language is line-oriented; definitions
and rules are separated by line breaks. There is no special notation for
comments, but (Turbo Pascal style) comments may be included as Turbo Pascal
fragments (see below).

The definitions section may contain the following elements:
\begin{itemize}
   \item
      regular definitions in the format:
      \begin{quote}\begin{verbatim}
   name   substitution
      \end{verbatim}\end{quote}
      which serve to abbreviate common subexpressions. The \verb"{name}"
      notation causes the corresponding substitution from the definitions
      section to be inserted into a regular expression. The name must be
      a legal identifier (letter followed by a sequence of letters and digits;
      the underscore counts as a letter; upper- and lowercase are distinct).
      Regular definitions must be non-recursive.
   \item
      start state definitions in the format:
      \begin{quote}\begin{verbatim}
   %start name ...
      \end{verbatim}\end{quote}
      which are used in specifying start conditions on rules (described
      below). The \verb"%start" keyword may also be abbreviated as \verb"%s"
      or \verb"%S".
   \item
      Turbo Pascal declarations enclosed between \verb"%{" and \verb"%}".
      These will be inserted into the output file (at global scope). Also,
      any line that does not look like a Lex definition (e.g., starts with
      blank or tab) will be treated as Turbo Pascal code. (In particular,
      this also allows you to include Turbo Pascal comments in your Lex
      program.)
\end{itemize}

The rules section of a TP Lex program contains the actual specification of
the lexical analyzer routine. It may be thought of as a big \verb"CASE"
statement discriminating over the different patterns to be matched and listing the
corresponding statements (actions) to be executed. Each rule consists of a
regular expression describing the strings to be matched in the input, and a
corresponding action, a Turbo Pascal statement to be executed when the
expression matches. Expression and statement are delimited with whitespace
(blanks and/or tabs). Thus the format of a Lex grammar rule is:

\begin{quote}\begin{verbatim}
   expression      statement;
\end{verbatim}\end{quote}

Note that the action must be a single Turbo Pascal statement terminated
with a semicolon (use \verb"begin ... end" for compound statements). The
statement may span multiple lines if the successor lines are indented with
at least one blank or tab. The action may also be replaced by the \verb"|"
character, indicating that the action for this rule is the same as that for
the next one.

The TP Lex library unit provides various variables and routines which are
useful in the programming of actions. In particular, the \verb"yytext" string
variable holds the text of the matched string, and the \verb"yyleng" Byte
variable its length.

Regular expressions are used to describe the strings to be matched in a
grammar rule. They are built from the usual constructs describing character
classes and sequences, and operators specifying repetitions and alternatives.
The precise format of regular expressions is described in the next section.

The rules section may also start with some Turbo Pascal declarations
(enclosed in \verb"%{ %}") which are treated as local declarations of the
actions routine.

Finally, the auxiliary procedures section may contain arbitrary Turbo
Pascal code (such as supporting routines or a main program) which is
simply tacked on to the end of the output file. The auxiliary procedures
section is optional.

\subsection*{Regular Expressions}

Table \ref{tab1} summarizes the format of the regular expressions
recognized by TP Lex (also compare Aho, Sethi, Ullman 1986, fig.\ 3.48).
$c$ stands for a single character, $s$ for a string, $r$ for a regular
expression, and $n,m$ for nonnegative integers.

\begin{table*}\centering
   \begin{tabular}{c|c|c}
      \hline\hline
      {\sc Expression}& {\sc Matches}& {\sc Example}\\
      \hline
      $c$& any non-operator character $c$& \verb"a"\\
      \verb"\"$c$& character $c$ literally& \verb"\*"\\
      \verb'"'$s$\verb'"'& string $s$ literally& \verb'"**"'\\
      \verb"."& any character but newline& \verb"a.*b"\\
      \verb"^"& beginning of line& \verb"^abc"\\
      \verb"$"& end of line& \verb"abc$"\\

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人精品免费视频| 热久久免费视频| 狠狠狠色丁香婷婷综合激情| kk眼镜猥琐国模调教系列一区二区 | 中文字幕的久久| 日韩综合小视频| 91丨porny丨首页| 国产日韩欧美精品电影三级在线 | 亚洲三级在线看| 国产一区二区在线观看免费| 欧美日韩国产综合一区二区三区 | 中文字幕一区二区三区av| 蜜桃av一区二区在线观看 | 成人av在线观| 久久九九影视网| 久久99精品视频| 欧美日韩精品欧美日韩精品| 亚洲免费在线播放| av电影在线观看一区| 国产欧美视频一区二区三区| 精品一区二区免费| 欧美大片在线观看一区二区| 日韩av电影免费观看高清完整版 | 精品国精品国产尤物美女| 亚洲v精品v日韩v欧美v专区 | 国产精品一区专区| 精品少妇一区二区三区免费观看| 视频精品一区二区| 欧美精品粉嫩高潮一区二区| 亚洲成av人影院在线观看网| 在线亚洲免费视频| 亚洲视频1区2区| gogo大胆日本视频一区| 中文字幕亚洲欧美在线不卡| 成人免费视频一区| 国产日韩欧美精品综合| 丁香天五香天堂综合| 久久精品夜色噜噜亚洲a∨| 精品无码三级在线观看视频| 精品剧情在线观看| 国产一区二区三区黄视频 | 日本亚洲视频在线| 91精品国产色综合久久ai换脸| 日韩精品一卡二卡三卡四卡无卡| 欧美区视频在线观看| 日韩精品亚洲一区| 日韩女优av电影在线观看| 免费观看91视频大全| 欧美精品一区二区三区在线播放| 国产一区二区美女| 中文字幕av一区二区三区高 | 国模大尺度一区二区三区| 精品久久人人做人人爰| 国产一区二区成人久久免费影院| 久久精品人人做| www..com久久爱| 一区二区三区蜜桃| 这里只有精品电影| 男人的j进女人的j一区| 精品国产乱码久久久久久图片 | 午夜免费久久看| 91麻豆精品国产91久久久使用方法| 人妖欧美一区二区| 国产亚洲一本大道中文在线| www.色综合.com| 亚洲高清视频中文字幕| 日韩一区二区三区四区五区六区| 久草中文综合在线| 国产精品免费网站在线观看| 91国产免费观看| 麻豆精品一区二区综合av| 国产欧美日韩三区| 在线视频你懂得一区二区三区| 日韩精品亚洲一区| 国产日韩av一区二区| 91高清视频在线| 久久精品国产99久久6| 中文字幕不卡的av| 欧美日韩aaaaa| 韩国av一区二区三区| 亚洲欧美激情视频在线观看一区二区三区| 欧美性生活大片视频| 国产真实乱子伦精品视频| 亚洲色图在线播放| 日韩一区二区免费在线观看| 国产成人亚洲综合a∨猫咪| 一区二区在线观看免费视频播放| 日韩亚洲欧美在线| 91网上在线视频| 美女看a上一区| 亚洲欧洲色图综合| 欧美一级片在线| av成人动漫在线观看| 日本va欧美va精品| 亚洲欧洲日产国码二区| 欧美一区二区福利在线| av在线综合网| 久草中文综合在线| 亚洲一区免费观看| 久久九九久久九九| 欧美精品色综合| 99久久久无码国产精品| 久久国产人妖系列| 亚洲午夜在线视频| 国产精品私房写真福利视频| 欧美一区二区女人| 日本久久电影网| 国产成人综合在线| 蜜臀99久久精品久久久久久软件| 亚洲欧洲综合另类| 国产日韩欧美一区二区三区乱码| 欧美高清性hdvideosex| 91麻豆免费在线观看| 国产在线精品一区二区夜色 | 亚洲欧美另类图片小说| 久久久久久久久久久久久夜| 欧美酷刑日本凌虐凌虐| av在线播放不卡| 国模冰冰炮一区二区| 日韩国产欧美三级| 亚洲一区电影777| 中文字幕一区二区三中文字幕| www国产亚洲精品久久麻豆| 欧美视频中文一区二区三区在线观看| 国产不卡在线视频| 狠狠色丁香久久婷婷综合丁香| 天天影视色香欲综合网老头| 亚洲欧美电影院| 国产精品家庭影院| 久久天天做天天爱综合色| 欧美精品aⅴ在线视频| 在线观看亚洲精品| 色综合天天视频在线观看| 成人av高清在线| 国产精品一区二区久久不卡| 蜜桃91丨九色丨蝌蚪91桃色| 视频在线观看一区| 亚洲一区二区视频| 亚洲精品国久久99热| 中文字幕一区二区三区视频| 国产精品色在线观看| 国产农村妇女毛片精品久久麻豆 | 欧美va亚洲va香蕉在线| 欧美丰满少妇xxxxx高潮对白| 色爱区综合激月婷婷| 99热国产精品| 国产成人自拍网| 粉嫩av一区二区三区在线播放| 国产一区二区在线看| 精品在线观看视频| 麻豆国产欧美日韩综合精品二区 | 精品在线播放免费| 久久97超碰色| 国产一区二区三区| 国产精品一区在线观看乱码| 国产激情91久久精品导航| 国产裸体歌舞团一区二区| 国产米奇在线777精品观看| 国产在线精品不卡| 国产99久久久精品| 成人高清免费观看| 91小视频在线免费看| 色婷婷国产精品| 欧美调教femdomvk| 777欧美精品| 欧美不卡视频一区| 精品88久久久久88久久久| 久久久www成人免费毛片麻豆| 国产日韩视频一区二区三区| 中文字幕一区二区在线播放| 一区二区三区在线免费播放| 亚洲永久精品大片| 日韩主播视频在线| 狠狠色丁香久久婷婷综合丁香| 岛国一区二区在线观看| 99精品在线免费| 欧美色男人天堂| 日韩一区二区三区免费观看 | 欧美日韩不卡在线| 日韩欧美一二三| 国产亚洲精品超碰| 亚洲欧美日韩中文字幕一区二区三区 | 日韩一区二区三区av| 国产视频在线观看一区二区三区| 中文字幕中文字幕在线一区| 一区二区三区国产豹纹内裤在线| 丝袜美腿亚洲一区二区图片| 国产真实精品久久二三区| 99久久国产综合精品麻豆| 欧美日韩精品欧美日韩精品一综合| 精品少妇一区二区三区日产乱码| 国产精品三级电影| 亚洲午夜激情av| 精品影视av免费| 91偷拍与自偷拍精品| 欧美一级欧美一级在线播放| 国产清纯美女被跳蛋高潮一区二区久久w | 日韩一卡二卡三卡国产欧美| 日本一区二区三区视频视频| 亚洲综合色丁香婷婷六月图片|