Skip to main content

module salix::util::Mode

rascal-0.40.17
salix-contrib-0.2.7

Usage

import salix::util::Mode;

Source code

http://github.com/usethesource/salix-contrib/src/main/rascal/salix/util/Mode.rsc

Dependencies

import Type;
import ParseTree;
import String;

data Mode

data Mode  
= mode(str name, list[State] states, map[str, value] meta = ())
;

data State

data State  
= state(str name, list[Rule] rules)
;

data Rule

data Rule  
= rule(str regex, list[str] tokens, str next = "", bool indent=false, bool dedent=false)
;

function cat2token

str cat2token("StringLiteral")

str cat2token("Comment")

str cat2token("Constant")

str cat2token("Variable")

default str cat2token(str _)

function grammar2mode

Mode grammar2mode(str name, type[&T <: Tree] sym)

function jsExample

Mode jsExample()