# (c) 1989, 1991 Andrew W. Appel, David R. Tarditi
# Compiled by:
#
src/app/yacc/src/mythryl-yacc.lib### "It's clever, but is it Art?"
###
### -- Rudyard Kipling
stipulate
package fil = file__premicrothread; # file__premicrothread is from
src/lib/std/src/posix/file--premicrothread.pkgherein
api Header {
#
Source_Position = Int;
lineno: Ref( Source_Position );
text: Ref( List( String ) );
Input_Source;
make_source: (String, fil::Input_Stream, fil::Output_Stream) -> Input_Source;
error: Input_Source -> Source_Position -> String -> Void;
warn: Input_Source -> Source_Position -> String -> Void;
error_occurred: Input_Source -> Void -> Bool;
Symbol = SYMBOL (String, Source_Position);
symbol_name: Symbol -> String;
symbol_pos: Symbol -> Source_Position;
symbol_make: (String, Int) -> Symbol;
Type;
name_of_type: Type -> String;
type_make: String -> Type;
# Associativities: Each kind of associativity
# is assigned a unique integer:
Precedence = LEFT
| RIGHT | NONASSOC;
Control
= NODEFAULT
| VERBOSE
| PURE
| NSHIFT List( Symbol )
| GENERIC String
| PARSER_NAME Symbol
| PARSE_ARG (String, String)
| POS String
| START_SYM Symbol
| TOKEN_API_INFO String
;
Rule = RULE {
lhs: Symbol,
rhs: List( Symbol ),
code: String,
prec: Null_Or( Symbol )
};
Decl_Data
=
DECL {
eop: List( Symbol ),
keyword: List( Symbol ),
nonterm: Null_Or( List ((Symbol, Null_Or (Type)))),
prec: List ((Precedence, ( List (Symbol)))),
change: List( (List (Symbol), List (Symbol))),
term: Null_Or (List ((Symbol, Null_Or (Type)))),
control: List( Control ),
value: List ((Symbol, String))
};
join_decls: (Decl_Data, Decl_Data, Input_Source, Source_Position) -> Decl_Data;
Parse_Result;
get_result: Parse_Result -> (String, Decl_Data, List( Rule ));
};
end;