Handling Grammar Cycles in the 1997 SML Definition

Abstract

Fully general parsers permit the syntax specification of formallanguages to be unrestricted, allowing language designersto use a syntax specification that supports semanticsspecification, but also permitting ambiguity. Language workbenchesthat support fully general grammars need toolswhich can generate robust default behaviour but also allowexperienced designers to specify particular choices when ambiguityis encountered. The standard longest match approachto ambiguity resolution is not robust when a grammar containscycles. Although cycles can be removed from a grammar,this disrupts the syntax specification. We present analgorithm that safely removes cycles from the shared packedparse forests generated by general parsers and explore theapplication of the algorithm to the 1997 SML Definition. Thealgorithm results in a sub-forest to which further designerspecifiedor default disambiguation rules can be applied

Similar works

This paper was published in Royal Holloway - Pure.

Having an issue?

Is data on this page outdated, violates copyrights or anything else? Report the problem now and we will take corresponding actions after reviewing your request.

Licence: http://creativecommons.org/licenses/by/4.0/