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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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$"\\

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线看日本不卡| 不卡一区二区三区四区| 麻豆高清免费国产一区| 欧美日韩一区二区欧美激情| 亚洲一区二区欧美日韩| 91精品国产综合久久婷婷香蕉 | 欧美韩日一区二区三区四区| 五月婷婷综合网| 欧美v国产在线一区二区三区| 久久99最新地址| 亚洲欧美区自拍先锋| 欧美日韩一级大片网址| 欧美日韩黄色一区二区| 国产大片一区二区| 亚洲电影一级黄| 国产精品污www在线观看| 777奇米成人网| 精品粉嫩超白一线天av| 欧美三区在线观看| 欧美一级高清大全免费观看| 99久久久无码国产精品| 狠狠色2019综合网| 亚洲高清免费一级二级三级| 欧美激情一区二区三区四区| 亚洲美腿欧美偷拍| 首页国产丝袜综合| 亚洲精品高清在线| 日韩毛片一二三区| 国产精品入口麻豆九色| 一区二区三区高清不卡| 一区二区三区四区不卡在线| 婷婷开心激情综合| 成人性生交大片| 国产成人在线影院| 欧美日韩三级一区二区| 久久久久高清精品| 国产精品超碰97尤物18| 欧美色男人天堂| 久久日一线二线三线suv| 欧美电影免费观看高清完整版在线观看 | 国产精品欧美一区喷水| 亚洲mv在线观看| 成人精品高清在线| 欧美α欧美αv大片| 亚洲人成影院在线观看| 国产综合成人久久大片91| 在线看国产一区| 国产亚洲精品精华液| www久久久久| 视频在线在亚洲| 色婷婷久久久综合中文字幕| 不卡av免费在线观看| 欧美大片一区二区三区| 亚洲乱码一区二区三区在线观看| 国产一区二区三区精品欧美日韩一区二区三区 | 丁香婷婷综合激情五月色| 高清av一区二区| 日韩精品一区在线观看| 亚洲福利一二三区| 在线免费视频一区二区| ●精品国产综合乱码久久久久| 亚洲激情自拍偷拍| heyzo一本久久综合| 欧美亚洲高清一区二区三区不卡| 欧美裸体bbwbbwbbw| 久久精品日产第一区二区三区高清版 | 欧美吻胸吃奶大尺度电影| 亚洲精品伦理在线| 91视频.com| 91麻豆精品91久久久久久清纯| 17c精品麻豆一区二区免费| 成人午夜伦理影院| 中文字幕第一页久久| 国产成a人无v码亚洲福利| 国产午夜精品一区二区三区嫩草 | 欧美中文字幕一区二区三区亚洲 | 三级久久三级久久久| 91电影在线观看| 欧美另类变人与禽xxxxx| 亚洲大尺度视频在线观看| 在线观看精品一区| 五月天一区二区| 欧美一区二区三区四区久久| 一区精品在线播放| 色综合久久中文字幕综合网| 亚洲欧美日韩国产综合| 欧美亚洲综合在线| 日韩在线卡一卡二| 日韩精品一区二区三区在线| 国产综合一区二区| 国产精品网站在线播放| 日本精品免费观看高清观看| 一区二区不卡在线视频 午夜欧美不卡在| 91浏览器入口在线观看| 午夜欧美在线一二页| 日韩精品一区二区三区视频 | 高潮精品一区videoshd| 亚洲欧美激情插| 在线播放亚洲一区| 国产在线观看一区二区| 亚洲人妖av一区二区| 欧美日韩国产成人在线91| 国产乱码字幕精品高清av| 欧美日韩精品欧美日韩精品一 | 欧美日韩一区二区在线观看视频 | 国产精品一区三区| 一区二区三区在线观看网站| 欧美一区二区三区四区久久 | 免费一级欧美片在线观看| 色婷婷综合久久久久中文| 日韩影视精彩在线| 国产精品成人免费精品自在线观看| 欧美系列亚洲系列| 国产一区二区三区美女| 亚洲一区二区三区四区五区中文 | 久久色在线视频| 欧美亚男人的天堂| 成人免费观看视频| 奇米精品一区二区三区四区| 国产精品不卡在线观看| 日韩欧美激情四射| 欧美日韩精品一区二区三区| 欧美这里有精品| 国产传媒日韩欧美成人| 琪琪久久久久日韩精品| 亚洲一区在线播放| 中文字幕的久久| 久久精品一区二区| 日韩三级视频中文字幕| 欧美日韩成人综合天天影院| 99re6这里只有精品视频在线观看| 另类人妖一区二区av| 亚洲一区电影777| 成人免费一区二区三区在线观看| 亚洲精品一区二区三区福利 | 中文子幕无线码一区tr| 日韩精品最新网址| 67194成人在线观看| 欧美一区二区三区不卡| 成人网页在线观看| 成人精品免费看| 日韩精品一区二区三区在线观看| 色播五月激情综合网| 粉嫩13p一区二区三区| 国产美女一区二区三区| 九九**精品视频免费播放| 日韩欧美国产综合一区| 欧美酷刑日本凌虐凌虐| 精品视频一区二区不卡| 欧美视频在线一区| 欧美在线免费观看亚洲| 欧美日韩精品综合在线| 欧美日免费三级在线| 欧美日韩国产成人在线免费| 欧美日韩1区2区| 日韩欧美黄色影院| 久久久久久久综合狠狠综合| 国产午夜精品一区二区 | av福利精品导航| 99免费精品视频| 色婷婷综合久久久中文一区二区| 99re热这里只有精品免费视频| 欧美日本国产视频| 欧美不卡一区二区三区四区| 欧美人伦禁忌dvd放荡欲情| 在线观看一区二区视频| 欧美在线观看视频在线| 91精品国产综合久久婷婷香蕉| 欧美成人伊人久久综合网| 精品国产电影一区二区| 国产精品美女久久久久aⅴ | 欧美中文字幕一二三区视频| 欧美欧美欧美欧美首页| 精品国产免费人成电影在线观看四季| 国产亚洲一本大道中文在线| 最新成人av在线| 日韩综合一区二区| 国产成人av福利| 欧美亚州韩日在线看免费版国语版| 欧美精品一卡两卡| 国产精品网站在线| 婷婷中文字幕一区三区| 国产成人一级电影| 欧美日韩精品是欧美日韩精品| 亚洲精品一区二区三区香蕉 | 国产精品黄色在线观看| 欧美一二区视频| 国产精品美女久久福利网站| 一区二区三区在线免费播放| 久久国产精品第一页| 一本色道a无线码一区v| 精品国产污网站| 亚洲综合在线视频| 国产不卡视频在线播放| 91精品国产综合久久久久久久| 国产精品传媒视频| 国产揄拍国内精品对白| 欧美日本免费一区二区三区| 中文字幕av不卡| 极品美女销魂一区二区三区免费 |