# (c) 1989, 1991 Andrew W. Appel, David R. Tarditi
# Compiled by:
#
src/app/yacc/src/mythryl-yacc.lib### "Love of beauty is Taste.
### The creation of beauty is Art."
###
### -- Ralph Waldo Emerson
api Core {
#
package grammar: Grammar; # Grammar is from
src/app/yacc/src/grammar.api package internal_grammar: Internal_Grammar; # Internal_Grammar is from
src/app/yacc/src/internal-grammar.api sharing
grammar == internal_grammar::grammar;
Item = ITEM
{ rule: internal_grammar::Rule,
dot: Int,
# rhs_after: The portion of the right-hand-side
# of a rule that lies after the dot
#
rhs_after: List( grammar::Symbol )
};
# eq_item and gt_item compare items:
#
eq_item: (Item, Item) -> Bool;
gt_item: (Item, Item) -> Bool;
# Functions for maintaining ordered item lists:
#
set: (Item, List(Item)) -> List(Item);
union: (List(Item), List(Item)) -> List(Item);
# core: a set of items. It is represented by an ordered list of items.
# The list is in ascending order The rule numbers and the positions of the
# dots are used to order the items.
#
Core = CORE (List( Item ), Int); # state
# gt_core and eqCore compare the lists of items:
#
gt_core: (Core, Core) -> Bool;
eq_core: (Core, Core) -> Bool;
# Functions for debugging:
#
print_item: ( (grammar::Symbol -> String),
(grammar::Nonterminal -> String),
(String -> Void)
)
-> Item
-> Void;
print_core: ( (grammar::Symbol -> String),
(grammar::Nonterminal -> String),
(String -> Void)
)
-> Core
-> Void;
};