DIRECTORY
  MStream USING [Handle],
  TreesDefs USING [TreeNode],
  ParseInterface USING [ActionEntry, TableRef, ProductionInfo, TSymbol];
  
ParseDefs: DEFINITIONS = {

		--	INTERFACE TYPES	--
	
  -- parse stack values (for use by semantics routines)	
  Value: TYPE = LONG STRING;
  Value2: TYPE = LONG POINTER TO TreesDefs.TreeNode;
   
  Token: TYPE = RECORD [
    class: ParseInterface.TSymbol,  	-- the token class
    value: Value,
    location: CARDINAL ];
  
		--	INTERFACE VARIABLES	--
		
  -- string to hold comment until they can be printed
  commentString: LONG STRING;
  
  		--	PARSING		--
		
  -- basic parsing procedure (does its own initialization)
  -- implemented by Parser.mesa
  Parse: PROCEDURE [stream: MStream.Handle];
  
  		--	SCANNING	--
	
  -- gets the next token
  -- implemented by scanner.mesa
  Atom: PROCEDURE RETURNS [symbol: Token];
  
  -- initializes the scanner (called by the parser initialization section)
  ScanInit: PROCEDURE [inputStream: MStream.Handle, table: ParseInterface.TableRef];
  
  -- Frees the buffer string in the scanner
  ScanFinal: PROCEDURE [];
  
  -- prints the recent context after a parse error
  ErrorContext: PROCEDURE [];
	
  		--	SEMANTICS	--
  
  -- this is called whenever a production is reduced (does the semantic processing)
  -- implemented by ParseDclsImpl.mesa
  ProcessQueue: PROCEDURE [qI, top: CARDINAL];
  
 
  -- allows the parse stack to be shared between the parser and the semantics
  -- routine (ProcessQueue)
  -- implemented by ParseDclsImpl.mesa
  AssignDescriptors: PROCEDURE [
    qd: LONG DESCRIPTOR FOR ARRAY OF ParseInterface.ActionEntry,
    vd: LONG DESCRIPTOR FOR ARRAY OF Value,
    v2d: LONG DESCRIPTOR FOR ARRAY OF Value2,
    ld: LONG DESCRIPTOR FOR ARRAY OF CARDINAL,
    pp: LONG DESCRIPTOR FOR ARRAY OF ParseInterface.ProductionInfo];
    
  
  -- second section of semantics (called by ProcessQueue)
  -- implemented by ParseStmtsImpl.mesa
  ParseStmts: PROCEDURE [rule: CARDINAL, top: CARDINAL,
  	v: LONG DESCRIPTOR FOR ARRAY OF Value,
	v2: LONG DESCRIPTOR FOR ARRAY OF Value2];
	
  
  -- third section of semantics (called by ProcessQueue)
  -- implemented by ParseExpr1Impl.mesa
  ParseExpr1: PROCEDURE [rule: CARDINAL, top: CARDINAL,
  	v: LONG DESCRIPTOR FOR ARRAY OF Value,
	v2: LONG DESCRIPTOR FOR ARRAY OF Value2];
	

  -- fourth section of semantics (called by ProcessQueue)
  -- implemented by ParseExpr2Impl.mesa 
  ParseExpr2: PROCEDURE [rule: CARDINAL, top: CARDINAL,
  	v: LONG DESCRIPTOR FOR ARRAY OF Value,
	v2: LONG DESCRIPTOR FOR ARRAY OF Value2];

  }.