--- Merging r29502 into '.':

U    utils/tply/pyacc.y
--- Merging r29503 into '.':
U    utils/tply/lexbase.pas
G    utils/tply/pyacc.y
U    utils/tply/pyacc.pas
U    utils/tply/plex.pas
U    utils/tply/yaccbase.pas
--- Merging r30289 into '.':
U    utils/tply/README.txt

# revisions: 29502,29503,30289

git-svn-id: branches/fixes_3_0@30825 -
This commit is contained in:
marco 2015-05-08 17:01:11 +00:00
parent 51389e4f3d
commit 9bb8c2f400
6 changed files with 162 additions and 132 deletions

View File

@ -16,7 +16,7 @@ available from the TPLY homepage:
For information about the Free Pascal Compiler, please refer to:
http://tfdec1.fys.kuleuven.ac.be/~michael/fpc/fpc.html
http://www.freepascal.org/
The manual can be found in the files tply.tex (TeX version) and tply.doc
(ASCII version) contained in the package. An extended version of the manual
@ -44,7 +44,7 @@ The original version of the TPLY package was written by Albert Graef
4.0-6.0. Berend de Boer <berend@pobox.com>, the current maintainer of the
Turbo/Borland Pascal version, adapted TPLY to take advantage of the large
memory models in Borland Pascal 7.0 and Delphi. Michael Van Canneyt
<Michael.VanCanneyt@fys.kuleuven.ac.be>, who maintains the Linux version of
<michael@freepascal.org>, who maintains the Linux version of
the Free Pascal compiler, is the author of the Free Pascal port.
@ -77,10 +77,9 @@ to store things :-) The 16-bit DPMI platforms have tables extended as large as
possible without changing basic Lex or Yacc sources.
This version was ported to Free Pascal by Michael Van Canneyt
<Michael.VanCanneyt@fys.kuleuven.ac.be> (April 1998).
<michael@freepascal.org> (April 1998).
*** Version 4.1 Michael Van Canneyt
<Michael.VanCanneyt@fys.kuleuven.ac.be>
*** Version 4.1 Michael Van Canneyt <michael@freepascal.org>
Albert Graef <ag@muwiinfa.geschichte.uni-mainz.de>
May 1998. Merges the Turbo and Free Pascal versions into a single package.
@ -142,6 +141,18 @@ from the lex.pas and yacc.pas programs), the Lex and Yacc code templates
(*.cod files), and the LexLib and YaccLib library units (compiled from
lexlib.pas and yacclib.pas).
The plex and pyacc programs will look for the *.cod files in the following locations:
For unix-like operating systems:
1. Current directory.
2. Directory given by FPCDIR
3. Directory /usr/local/lib/fpc/lexyacc
4. Directory /usr/lib/fpc/lexyacc
For other operating systems (dos/windows-like) :
1. Current directory.
2. Directory given by FPCDIR
3. Directory where the executable is located.
For the Free Pascal/Linux version, a Makefile is provided. To install, issue
the command `make' (maybe you have to edit the Makefile before this to reflect
your setup) and then `make install'. Note that in the Linux version the

View File

@ -65,7 +65,8 @@ lfilename : String;
pasfilename : String;
lstfilename : String;
codfilename : String;
codfilepath : String; { Under linux, binary and conf file
codfilepath1,
codfilepath2 : String; { Under linux, binary and conf file
are not in the same path}
(* Lex input, output, list and code template file: *)

View File

@ -62,7 +62,7 @@ $History: LEX.PAS $
program Lex;
uses
LexBase, LexTable, LexPos, LexDFA, LexOpt, LexList, LexRules, LexMsgs;
LexBase, LexTable, LexPos, LexDFA, LexOpt, LexList, LexRules, LexMsgs, SysUtils;
procedure get_line;
@ -597,15 +597,14 @@ var i : Integer;
begin
{$ifdef Unix}
{$ifdef BSD}
codfilepath:='/usr/local/lib/fpc/lexyacc/';
{$else}
codfilepath:='/usr/lib/fpc/lexyacc/';
{$endif}
codfilepath1:='/usr/local/lib/fpc/lexyacc/';
codfilepath2:='/usr/lib/fpc/lexyacc/';
{$else}
codfilepath:=path(paramstr(0));
codfilepath1:=path(paramstr(0));
codfilepath2:='';
{$endif}
(* sign-on: *)
writeln(sign_on);
@ -662,17 +661,29 @@ begin
rewrite(yyout); if ioresult<>0 then fatal(cannot_open_file+pasfilename);
rewrite(yylst); if ioresult<>0 then fatal(cannot_open_file+lstfilename);
(* search code template in current directory, then on path where Lex
was executed from: *)
(* search code template *)
codfilename := 'yylex.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then
begin
codfilename := codfilepath+'yylex.cod';
codfilename := IncludeTrailingPathDelimiter(GetEnvironmentVariable('FPCDIR'))+'lexyacc'+DirectorySeparator+'yylex.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then fatal(cannot_open_file+codfilename);
if ioresult<>0 then
begin
codfilename := codfilepath1+'yylex.cod';
assign(yycod, codfilename);
reset(yycod);
if (codfilepath2<>'') and (ioresult<>0) then
begin
codfilename := codfilepath2+'yylex.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then
fatal(cannot_open_file+codfilename);
end;
end;
end;
(* parse source grammar: *)

View File

@ -110,7 +110,7 @@ uses
YaccChk source not available anymore PM }
{$ENDIF}
{$ENDIF}
YaccLib, YaccBase, YaccMsgs, YaccSem, YaccTabl, YaccPars;
YaccLib, YaccBase, YaccMsgs, YaccSem, YaccTabl, YaccPars, SysUtils;
const ID = 257;
const C_ID = 258;
@ -2375,13 +2375,11 @@ var i : Integer;
begin
{$ifdef Unix}
{$ifdef BSD}
codfilepath:='/usr/local/lib/fpc/lexyacc/';
{$else}
codfilepath:='/usr/lib/fpc/lexyacc/';
{$endif}
codfilepath1:='/usr/local/lib/fpc/lexyacc/';
codfilepath2:='/usr/lib/fpc/lexyacc/';
{$else}
codfilepath:=path(paramstr(0));
codfilepath1:=path(paramstr(0));
codfilepath2:='';
{$endif}
(* sign-on: *)
@ -2440,17 +2438,29 @@ begin
rewrite(yyout); if ioresult<>0 then fatal(cannot_open_file+pasfilename);
rewrite(yylst); if ioresult<>0 then fatal(cannot_open_file+lstfilename);
(* search code template in current directory, then on path where Yacc
was executed from: *)
(* search code template *)
codfilename := 'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then
begin
codfilename := codfilepath+'yyparse.cod';
codfilename := IncludeTrailingPathDelimiter(GetEnvironmentVariable('FPCDIR'))+'lexyacc'+DirectorySeparator+'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then fatal(cannot_open_file+codfilename);
if ioresult<>0 then
begin
codfilename := codfilepath1+'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if (codfilepath2<>'') and (ioresult<>0) then
begin
codfilename := codfilepath2+'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then
fatal(cannot_open_file+codfilename);
end;
end;
end;
(* parse source grammar: *)

View File

@ -55,7 +55,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Revision: 1.3 $
$Revision: 1.5 $
$Modtime: 96-08-01 11:24 $
@ -129,16 +129,6 @@ $History: YACC.PAS $
*)
{$IFDEF MsDos}
{$M 16384,0,655360}
{$ENDIF}
{$IFDEF DPMI}
{$M 32768}
{$ENDIF}
{$IFDEF Windows}
{$M 32768,0}
{$ENDIF}
{$X+}
{$I-}
program Yacc;
@ -146,15 +136,11 @@ program Yacc;
uses
{$IFDEF Debug}
{$IFDEF DPMI}
YaccChk,
{ YaccChk, removed as obsolete,
YaccChk source not available anymore PM }
{$ENDIF}
{$ENDIF}
{$IFDEF Windows}
{$IFNDEF Console}
WinCrt,
{$ENDIF}
{$ENDIF}
YaccLib, YaccBase, YaccMsgs, YaccSem, YaccTabl, YaccPars;
YaccLib, YaccBase, YaccMsgs, YaccSem, YaccTabl, YaccPars, SysUtils;
%}
@ -725,13 +711,11 @@ var i : Integer;
begin
{$ifdef Unix}
{$ifdef BSD}
codfilepath:='/usr/local/lib/fpc/lexyacc/';
{$else}
codfilepath:='/usr/lib/fpc/lexyacc/';
{$endif}
codfilepath1:='/usr/local/lib/fpc/lexyacc/';
codfilepath2:='/usr/lib/fpc/lexyacc/';
{$else}
codfilepath:=path(paramstr(0));
codfilepath1:=path(paramstr(0));
codfilepath2:='';
{$endif}
(* sign-on: *)
@ -790,17 +774,29 @@ begin
rewrite(yyout); if ioresult<>0 then fatal(cannot_open_file+pasfilename);
rewrite(yylst); if ioresult<>0 then fatal(cannot_open_file+lstfilename);
(* search code template in current directory, then on path where Yacc
was executed from: *)
(* search code template *)
codfilename := 'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then
begin
codfilename := codfilepath+'yyparse.cod';
codfilename := IncludeTrailingPathDelimiter(GetEnvironmentVariable('FPCDIR'))+'lexyacc'+DirectorySeparator+'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then fatal(cannot_open_file+codfilename);
if ioresult<>0 then
begin
codfilename := codfilepath1+'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if (codfilepath2<>'') and (ioresult<>0) then
begin
codfilename := codfilepath2+'yyparse.cod';
assign(yycod, codfilename);
reset(yycod);
if ioresult<>0 then
fatal(cannot_open_file+codfilename);
end;
end;
end;
(* parse source grammar: *)

View File

@ -66,7 +66,8 @@ yfilename : String;
pasfilename : String;
lstfilename : String;
codfilename : String;
codfilepath : String; { Under Linux,
codfilepath1,
codfilepath2 : String; { Under Linux,
binary and conf file are never in 1 directory.}
(* Yacc input, output, list and code template file: *)