(* ML-Yacc Parser Generator (c) 1989 Andrew W. Appel, David R. Tarditi *)
(* functor Join creates a user parser by putting together a Lexer structure, anLrValuesstructure,andapolymorphicparserstructure.Notethat theLexerandLrValuesstructuremustsharethetypepos(i.e.thetype oflinenumbers),thetypesvaluesforsemanticvalues,andthetype oftokens.
*)
type arg = ParserData.arg type pos = ParserData.pos type result = ParserData.result type svalue = ParserData.svalue val makeLexer = LrParser.Stream.streamify o Lex.makeLexer val parse = fn (lookahead,lexer,error,arg) =>
(fn (a,b) => (ParserData.Actions.extract a,b))
(LrParser.parse {table = ParserData.table,
lexer=lexer,
lookahead=lookahead,
saction = ParserData.Actions.actions,
arg=arg,
void= ParserData.Actions.void,
ec = {is_keyword = ParserData.EC.is_keyword,
noShift = ParserData.EC.noShift,
preferred_change = ParserData.EC.preferred_change,
errtermvalue = ParserData.EC.errtermvalue,
error=error,
showTerminal = ParserData.EC.showTerminal,
terms = ParserData.EC.terms}}
) val sameToken = Token.sameToken end
(* functor JoinWithArg creates a variant of the parser structure produced above.Inthiscase,themakeLexertakeanadditionalargumentbefore yieldingavalueoftypeunit->(svalue,pos)token
*)
type arg = ParserData.arg type lexarg = Lex.UserDeclarations.arg type pos = ParserData.pos type result = ParserData.result type svalue = ParserData.svalue
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.