Skip to main content

module analysis::grammars::dramb::GenerateTrees

rascal-0.40.17
drambiguity-0.3.5

Usage

import analysis::grammars::dramb::GenerateTrees;

Source code

http://github.com/cwi-swat/drambiguity/blob/main/src/analysis/grammars/dramb/GenerateTrees.rsc

Dependencies

import util::Math;
import Set;
import List;
import Boolean;
import ParseTree;
import Grammar;
import lang::rascal::grammar::definition::Regular;
import lang::rascal::grammar::definition::Literals;
import lang::rascal::grammar::definition::Parameters;
import IO;
import analysis::grammars::dramb::Detection;
import analysis::grammars::dramb::Termination;
import analysis::grammars::dramb::Conditions;
import analysis::grammars::dramb::Simplify;
import analysis::grammars::dramb::Util;
import Exception;
import analysis::grammars::Dependency;

data opt

data opt[&T]  
= yes(&T thing)
| no()
;

function findAmbiguousSubString

opt[str] findAmbiguousSubString(type[Tree] gr, int effort)

function findAmbiguousSubTree

opt[Tree] findAmbiguousSubTree(type[Tree] gr, int effort)

function randomAmbiguousSubStrings

set[str] randomAmbiguousSubStrings(type[Tree] grammar, int max)

function randomAmbiguousSubTrees

set[Tree] randomAmbiguousSubTrees(type[Tree] grammar, int max)

function randomStrings

set[str] randomStrings(type[Tree] grammar, int max)

function randomTrees

set[Tree] randomTrees(type[Tree] gr, int max)

function randomTree

Tree randomTree(type[Tree] gr)

Tree randomTree(\char-class(list[CharRange] ranges), int rec, map[Symbol, set[Production]] _)

default Tree randomTree(Symbol sort, int rec, map[Symbol, set[Production]] gr)

function randomAlt

default Production randomAlt(Symbol sort, set[Production] alts, int rec)

function randomChar

Tree randomChar(range(int min, int max))

data Production

data Production (int distance = 0)

function completeGrammar

type[Tree] completeGrammar(type[Tree] gr)