Skip to content

Instantly share code, notes, and snippets.

View rohit-nsit08's full-sized avatar

rohit jangid rohit-nsit08

View GitHub Profile
@rohit-nsit08
rohit-nsit08 / parrot-javascript compiler
Created March 26, 2011 16:29
project proposal for javascript compiler
Name: Rohit Jangid
Email id: rohit.nsit08@gmail.com
Google id: rohit.nsit08
Other contact info:
Irc nick-name on #parrot channel: rohit_nsit08
Project title: JavaScript on Parrot
@rohit-nsit08
rohit-nsit08 / parrot_javascript version 1
Created March 27, 2011 05:36
project: javascript on parrot
Name: Rohit Jangid
Email id: rohit.nsit08@gmail.com
Google id: rohit.nsit08
Other contact info:
Irc nick-name on #parrot channel: rohit_nsit08
Project title: JavaScript on Parrot
@rohit-nsit08
rohit-nsit08 / javascript-compiler on parrot- version 3
Created March 28, 2011 20:04
my Proposal for javascript compiler on Parrot
NAME: Rohit Jangid
EMAIL ID: rohit.nsit08@gmail.com
GOOGLE ID: rohit.nsit08
OTHER CONTACT INFO:
Irc nick-name on #parrot channel: rohit_nsit08
PROJECT TITLE: JavaScript on Parrot
@rohit-nsit08
rohit-nsit08 / JavaScript Compiler. final version
Created April 2, 2011 19:34
My GSOC proposal for "JavaScript on Parrot"
NAME: Rohit Jangid
EMAIL ID: rohit.nsit08@gmail.com
GOOGLE ID: rohit.nsit08
OTHER CONTACT INFO:
Irc nick-name on #parrot channel: rohit_nsit08
skype id : rohit_nsit08
@rohit-nsit08
rohit-nsit08 / numgame2.c
Created April 23, 2011 13:31
codechef-april
/*Problem description
Alice and Bob play the following game.They choose a number N to play with.The runs are as follows :
1.Bob plays first and the two players alternate.
2.In his/her turn ,a player can subtract from N any prime number(including 1) less than N.The number thus obtained is the new N.
3.The person who cannot make a move in his/her turn loses the game.
Assuming both play optimally,who wins the game ?
*/
/*solution*/
#include<stdio.h>
@rohit-nsit08
rohit-nsit08 / js.js
Created May 3, 2011 19:23
cafe.js module
var protoParser = require("./js/parser").parser,
nodes = require("./js/nodes"),
codegen = require("./js/codegen");
function Compiler () {
var constructors = {},
prototypes = {};
// Define AST nodes
@rohit-nsit08
rohit-nsit08 / codegen.js
Created May 3, 2011 19:50
code generator
var indentChar = ' '; //4 spaces
function idt (lvl) {
if (lvl < 0) lvl = 0;
return Array(lvl+1).join(indentChar);
}
var codegens = exports.nodes = {
'Empty': function Empty_codegen () {
@rohit-nsit08
rohit-nsit08 / jsString
Created July 15, 2011 17:56
jsString in PIR
.namespace []
.sub main
$P1 = subclass 'String', 'jsString' # subclass default string pmc into jsString type
addattribute $P1, 'primitive'
$P7 = box "ROHIT"
$P2 = new 'jsString' # instantiate the new string object
setattribute $P2, "primitive", $P7
@rohit-nsit08
rohit-nsit08 / tree.c
Created July 17, 2011 12:42
tree representation and node deletion
// creates a binary search tree
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
struct node* left;
struct node* right;
int value;
}treenode;
@rohit-nsit08
rohit-nsit08 / hello gist
Created August 10, 2011 12:02
test gist
test gist application