Skip to content

Instantly share code, notes, and snippets.

View jurgenvinju's full-sized avatar
🚠
in the lift

Jurgen J. Vinju jurgenvinju

🚠
in the lift
View GitHub Profile
@jurgenvinju
jurgenvinju / TestRecovery.rsc
Created October 4, 2012 14:19
A test file to experiment with the robust parsing feature of Rascal
module TestRecovery
extend lang::pico::\syntax::Main;
import util::IDE;
import ParseTree;
import IO;
public map[Production robust, CharClass lookaheads] robust
= (p:[range(10,10),range(59,59)] | /p:prod(label(_,sort("Statement")),_,_) := #Statement)
+ (p:[range(10,10),range(59,59),range(44,44)] | /p:prod(label(_,sort("IdType")),_,_) := #IdType);
@jurgenvinju
jurgenvinju / ListOffside.rsc
Created October 4, 2012 13:46
A working experiment (co-authored with @seba--) on implementing his disambiguation declarations for layout-sensitive languages in Rascal
@doc{an alternative to Offside.rsc which directly uses * lists instead of manual recursion}
module ListOffside
import IO;
start syntax Program = program: Def*;
lexical Id = [a-z]+;
syntax Def