Skip to main content

module analysis::grammars::dramb::DrAmbiguity

rascal-0.43.0
org.rascalmpl.drambiguity-0.4.0

Usage​

import analysis::grammars::dramb::DrAmbiguity;

Dependencies​

extend analysis::grammars::dramb::Model;
import Boolean;
import DateTime;
import Grammar;
import IO;
import List;
import ParseTree;
import Set;
import String;
import ValueIO;
import analysis::grammars::dramb::Brackets;
import analysis::grammars::dramb::Detection;
import analysis::grammars::dramb::Diagnose;
import analysis::grammars::dramb::GenerateTrees;
import analysis::grammars::dramb::GrammarEditor;
import analysis::grammars::dramb::Popups;
import analysis::grammars::dramb::Simplify;
import analysis::grammars::dramb::Util;
import lang::rascal::format::Grammar;
import salix::App;
import salix::Core;
import salix::HTML;
import salix::Index;
import salix::Node;
import salix::lib::Bootstrap;
import salix::util::SaveLoad;
import salix::util::WithPopups;
import util::Math;
import util::Maybe;
import util::Reflective;
import vis::Text;

function drAmbiguity​

start DrAmbiguity with a fresh grammar and an example input sentence

App[Model] drAmbiguity(type[&T <: Tree] grammar, loc input)

function drAmbiguity​

Continue DrAmbiguity with a previously saved project

App[Model] drAmbiguity(loc project)

function drAmbiguity​

start DrAmbiguity with a fresh grammar and an example input sentence

App[Model] drAmbiguity(type[&T <: Tree] grammar, str input)

function drAmbiguity​

start DrAmbiguity with a fresh grammar and no input sentence yet

App[Model] drAmbiguity(type[&T <: Tree] grammar)

function drAmbiguity​

start DrAmbiguity with a fresh grammar and a corresponding example (ambiguous) example tree

App[Model] drAmbiguity(type[&T <: Tree] grammar, &T input)

function drAmbiguity​

This is the internal work horse that boots up the Salix application that is called DrAmbiguity.

App[Model] drAmbiguity(Model m, str id = "DrAmbiguity")

function docDrAmbiguity​

App[Model] docDrAmbiguity(Model m)

data Msg​

data Msg  
= labels()
| literals()
| \layout()
| chars()
| focus()
| simplify()
| formatGrammar()
| freshSentence()
| newInput(str x)
| selectExample(int count)
| removeExample(int count)
| changeGenerationEffort(int count)
| storeInput()
| newGrammar(str x)
| commitGrammar(int selector)
| setStartNonterminal(Symbol s)
| clearErrors()
| removeGrammar(int count)
| commitMessage(str msg)
| setTab(Tab t)
;

function update​

Model update(setTab(Tab t), Model m)

Model update(clearErrors(), Model m)

Model update(labels(), Model m)

Model update(literals(), Model m)

Model update(\layout(), Model m)

Model update(Msg::chars(), Model m)

Model update(Msg::focus(), Model m)

Model update(commitMessage(str msg), Model m)

Model update(removeGrammar(int count), Model m)

Model update(Msg::formatGrammar(), Model m)

Model update(selectExample(int count), Model m)

Model update(removeExample(int count), Model m)

Model update(changeGenerationEffort(int count), Model m)

Model update(newGrammar(str x), Model m)

function status​

str status(nothing())

str status(just(Tree x))

default str status(just(Tree x))

function update​

Model update(storeInput(), Model m)

Model update(setStartNonterminal(Symbol s), Model m)

Model update(Msg::commitGrammar(int selector), Model m)

Model update(newInput(str new), Model m)

Model update(Msg::simplify(), Model m)

Model update(Msg::freshSentence(), Model m)

function freshSentences​

Model freshSentences(Model m)

function graphic​

void graphic(Model m)

function onNewSentenceInput​

Msg onNewSentenceInput(str t)

function onNewGrammarInput​

Msg onNewGrammarInput(str t)

function onTab​

Msg onTab(Tab t)

function view​

void view(Model m)

function onCommitMessageInput​

Msg onCommitMessageInput(str m)

function grammarPane​

void grammarPane(Model m)

function newAmountInput​

Msg newAmountInput(str i)

function fileUI​

void fileUI()

function inputPane​

void inputPane(Model m)

function focusButton​

void focusButton()

function simplifyButton​

void simplifyButton()

function graphicPane​

void graphicPane(Model m)

function focus​

Model focus(Model m)

function prodlabel​

str prodlabel(regular(Symbol s))

str prodlabel(prod(label(str x, _), _, _))

str prodlabel(prod(_, list[Symbol] args: [*_, lit(_), *_], _))

default str prodlabel(prod(Symbol s, _, _))