Skip to content

Instantly share code, notes, and snippets.

View manuelleduc's full-sized avatar

Manuel Leduc manuelleduc

View GitHub Profile
package fr.mleduc.simplelanguage.revisitor.revisitors;
import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.FrameSlotKind;
import com.oracle.truffle.api.frame.FrameUtil;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.profiles.BranchProfile;
import com.oracle.truffle.api.profiles.ConditionProfile;
grammar test.enumz.TestEnum with org.eclipse.xtext.common.Terminals
generate testEnum "http://www.enumz.test/TestEnum"
// https://stackoverflow.com/a/27024776/657524
Pattern returns Pattern:
d=Direction;
enum Direction:
XNumberLiteral returns XExpression :
{XNumberLiteral} value=Number;
Number hidden():
HEX | (INT | DECIMAL) ('.' (INT | DECIMAL))?;
terminal HEX:
('0x'|'0X') ('0'..'9'|'a'..'f'|'A'..'F'|'_')+
('#' (('b'|'B')('i'|'I') | ('l'|'L')))?;
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Spock
import Web.Spock.Config
import Control.Monad.Trans
import Data.Aeson hiding (json)
import Data.IORef
@manuelleduc
manuelleduc / SimpleFeatureModel.java
Last active November 28, 2017 16:43
Simple feature model instantiation and configuration with featureIDE libraries
package fr.inria.diverse.melange;
import org.sat4j.specs.TimeoutException;
import de.ovgu.featureide.fm.core.base.IFeatureModel;
import de.ovgu.featureide.fm.core.base.impl.DefaultFeatureModelFactory;
import de.ovgu.featureide.fm.core.base.impl.FMFactoryManager;
import de.ovgu.featureide.fm.core.base.impl.Feature;
import de.ovgu.featureide.fm.core.configuration.Configuration;
@manuelleduc
manuelleduc / ynh-no-icon.css
Created September 19, 2017 14:54
hidding the yunohost icon in a webapp
#ynh-overlay-switch {
display: none !important;
}
@manuelleduc
manuelleduc / modularexp_IDEAS.md
Created June 29, 2017 08:28
modularexp with mult extension

IDEAS

  • Test modular integration of variables + ctx
  • Removing boilerplate acceptors and visitors
  • More abstract datatypes ~> Monoid[_] == Sum
  • Adding mutable of mutable like operations
@manuelleduc
manuelleduc / modularvisitor.scala
Created June 28, 2017 12:20
Modular visitor in scala
package modularexp
import scala.language.higherKinds
/**
* Created by mleduc on 28/06/17.
*/
trait Exp[A]
trait Sum[A] extends Exp[A] {
import Html exposing (..)
import Html.Events exposing (onInput, onClick)
import Html.Attributes exposing (value)
import Char
import Dict exposing (Dict)
import Parser exposing(Parser, (|.), (|=), succeed, oneOrMore, zeroOrMore, int, symbol, oneOf, lazy, ignore, run, keyword)
-- Prog entry point
main = Html.beginnerProgram { model = model, view = view, update = update }
@manuelleduc
manuelleduc / OAMT.xtend
Last active February 16, 2017 09:39 — forked from tdegueul/OAMT.xtend
Attempting to map OA and MT theories
package oamt
import java.util.List
import java.util.Map
import org.eclipse.xtend.lib.annotations.Accessors
/**
* Fsm AS
*/
class FSM {