|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T V
Length: 4512 (0x11a0)
Types: TextFile
Names: »V«
└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
└─⟦0c20f784e⟧ »DATA«
└─⟦1abbe589f⟧
└─⟦591c5b094⟧
└─⟦this⟧
with Text_Io;
with Vstring_Type;
use Vstring_Type;
package Lexemes is
------------------------------------------------------------------------------
-- Recognition and separation of lexemes within the input stream.
------------------------------------------------------------------------------
-- Copyright 1989 - 1991 by Rational, Santa Clara, California.
--
-- All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice(s) appear in all copies and that
-- both that copyright notice(s) and this permission notice appear in
-- supporting documentation, and that the name of Rational not be used in
-- advertising or publicity pertaining to distribution of the software
-- without specific, written prior permission.
--
-- Rational disclaims all warranties with regard to this software, including
-- all implied warranties of merchantability and fitness, in no event shall
-- Rational be liable for any special, indirect or consequential damages or
-- any damages whatsoever resulting from loss of use, data or profits, whether
-- in an action of contract, negligence or other tortious action, arising out
-- of or in connection with the use or performance of this software.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Lexeme_Kind - The lexemes that we recognize
------------------------------------------------------------------------------
type Lexeme_Kind is (Lk_If,
Lk_Then,
Lk_Elsif,
Lk_Else,
Lk_End,
Lk_Identifier, -- recognized parameter name
Lk_Unknown, -- unknown/misspelled parameter name
Lk_Not,
Lk_And,
Lk_Or,
Lk_Xor,
Lk_Eql, -- =
Lk_Neq, -- /=
-- lk_gtr,
-- lk_lss,
-- lk_geq,
-- lk_leq,
Lk_Vbar, -- |
Lk_Arrow, -- =>
Lk_Comma, -- ,
Lk_Semicolon, -- ;
Lk_Lparen, -- (
Lk_Rparen, -- )
Lk_Error, -- bad character, bad token
Lk_Eol); -- end of line
------------------------------------------------------------------------------
-- Symbol_Value - Each named keyword or parameter has a value of this type and
-- kind.
------------------------------------------------------------------------------
type Symbol_Kind is (Sk_Keyword, -- control keyword
Sk_Boolean); -- boolean value
type Symbol_Value (Kind : Symbol_Kind := Sk_Boolean) is
record
Permanent : Boolean;
case Kind is
when Sk_Keyword =>
Kwd : Lexeme_Kind;
when Sk_Boolean =>
Bool : Boolean;
end case;
end record;
--\f
procedure Next_Lexeme (Line : Vstring;
Lexeme : in out Lexeme_Kind;
Text : in out Vstring;
Value : in out Symbol_Value);
------------------------------------------------------------------------------
-- Line - Specifies the input line/fragment to scan
-- Lexeme - Receives the Lexeme_Kind of the next lexeme
-- Text - Receives the textual representation of the next lexeme; if any
-- Value - Receives the value associated with the lexeme; if any
--
-- Called to scan the Line and to recognize and remove the next lexeme.
-- Lexeme is set to Lk_Error if we get confused. Lk_Eol is returned if
-- the line is empty or ends with a comment. The Text argument is only
-- set for Lk_Identifier values. The Value argument is changed for any
-- lexeme value that is a name (keywords and parameter names); it's value
-- only has meaning for Lk_Identifiers.
------------------------------------------------------------------------------
--\f
end Lexemes;