Skip to content

Instantly share code, notes, and snippets.

Avatar

Adil Akhter adilakhter

View GitHub Profile
View example.aterm
DatabaseSchema(
"example"
, [ Table(
"User"
, [ Column("id", UuidDBType())
, Column("name", StringDBType())
, Column("password", StringDBType())
, Reference("url", "URL")
]
)
@adilakhter
adilakhter / gist:991799
Created May 25, 2011
spoofaxlang-example1
View gist:991799
package lang.entity
module syntax-definition
context-free start-symbols
Start
context-free syntax
View test.hs
module Main where
a = b+c
where
b = 1
c = 2
d = a * 2
factorial n= product [1..n]
@adilakhter
adilakhter / antoutput.txt
Created Jul 22, 2011
Ant output of stratego.jvm.helper:
View antoutput.txt
stratego.jvm.helper:
[java] [ Main | warning ] Found more than one matching subdirectory found for 'sdf2imp/lib'!
[java] ["C:/work/projects/spoofax/spx-imp/source-codes/trunk/org.strategoxt.imp.generator/src/sdf2imp/lib","C:\\work\\projects\\spoofax\\spx-imp\\source-codes\\trunk\\org.strategoxt.imp.generator\\src/sdf2imp/lib"]
[java] [ Main | warning ] Found more than one matching subdirectory found for 'sdf2imp/util'!
[java] ["C:/work/projects/spoofax/spx-imp/source-codes/trunk/org.strategoxt.imp.generator/src/sdf2imp/util","C:\\work\\projects\\spoofax\\spx-imp\\source-codes\\trunk\\org.strategoxt.imp.generator\\src/sdf2imp/util"]
[java] [ Main | warning ] Found more than one matching subdirectory found for 'sdf2imp/services'!
[java] ["C:/work/projects/spoofax/spx-imp/source-codes/trunk/org.strategoxt.imp.generator/src/sdf2imp/services","C:\\work\\projects\\spoofax\\spx-imp\\source-codes\\trunk\\org.strategoxt.imp.generator\\src/s
@adilakhter
adilakhter / antoutput2.txt
Created Jul 22, 2011
stratego.jvm.helper target
View antoutput2.txt
stratego.jvm.helper:
[delete] Could not find file C:\work\projects\spoofax\spx-imp\source-codes\trunk\org.strategoxt.imp.generator\include\sdf2imp.rtree to delete.
[java] running org.strategoxt.strj.Main with default permissions (exit forbidden)
[java] Running in same VM Executing 'org.strategoxt.strj.Main' with arguments:
[java] '-i'
[java] 'C:\work\projects\spoofax\spx-imp\source-codes\trunk\org.strategoxt.imp.generator\src/sdf2imp.str'
[java] '-o'
[java] 'C:\work\projects\spoofax\spx-imp\source-codes\trunk\org.strategoxt.imp.generator\src-gen\org\strategoxt\imp\generator/sdf2imp.java'
[java] '-p'
View sdf2imp_0_0.java
package org.strategoxt.imp.generator;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.stratego_sglr.*;
import org.strategoxt.stratego_gpp.*;
import org.strategoxt.stratego_xtc.*;
import org.strategoxt.stratego_aterm.*;
import org.strategoxt.stratego_rtg.*;
import org.strategoxt.stratego_sglr.*;
View InteropRegisterer.java
package org.strategoxt.imp.generator;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.stratego_sglr.*;
import org.strategoxt.stratego_gpp.*;
import org.strategoxt.stratego_xtc.*;
import org.strategoxt.stratego_aterm.*;
import org.strategoxt.stratego_rtg.*;
import org.strategoxt.stratego_sglr.*;
@adilakhter
adilakhter / sym_op.fs
Created Nov 18, 2012
symbolic operator fsharp
View sym_op.fs
let rec (!) n =
match n with
| 1 -> (1)
| n -> n*(n-1)
View generics.fs
// 'a is f#'s way of indicating a generic type that is not known at compile time
let f x = x.ToString() + " string" //val x: 'a -> string
let f x y = x.ToString() + "" + y.TString(); // val f: 'a -> 'b -> string
View gist:4124078
// naive implementation
let rec length list =
match list with
| [] -> 0
| _::tail -> 1 + computeLength tail
You can’t perform that action at this time.