Skip to content

Instantly share code, notes, and snippets.

View Lisprez's full-sized avatar
🦒
I am looking for a job in Canada

Lisprez

🦒
I am looking for a job in Canada
View GitHub Profile
@Lisprez
Lisprez / LL1-parser-first-follow-sets.js
Created February 15, 2023 10:28 — forked from DmitrySoshnikov/LL1-parser-first-follow-sets.js
LL(1) Parser. Parsing table, part 1: First and Follow sets.
/**
* LL(1) parser. Building parsing table, part 1: First and Follow sets.
*
* NOTICE: see full implementation in the Syntax tool, here:
* https://github.com/DmitrySoshnikov/syntax/blob/master/src/sets-generator.js
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style License
*
* An LL(1)-parser is a top-down, fast predictive non-recursive parser,
@Lisprez
Lisprez / epoll.go
Created March 29, 2019 06:47 — forked from tevino/epoll.go
Golang example for using epoll
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@Lisprez
Lisprez / singleton.hpp
Created March 29, 2019 06:47 — forked from bianjiang/singleton.hpp
A C++11 singleton template with variadic parameters support
//
// __SINGLETON_HPP__
//
// The MIT License (MIT)
// Copyright (c) <2013> <Jiang Bian jbian@uams.edu>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
import re, sys # this file requires python 3
def parse(tokens):
stack = ([], None)
for t in tokens:
if t == '(':
stack = ([], stack)
elif t == ')':
(finished_list, stack) = stack
stack[0].append(finished_list)
elif not t.startswith(';;'):
@Lisprez
Lisprez / lisp.c
Created July 25, 2018 08:39 — forked from sanxiyn/lisp.c
Lisp
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,
0xE22Cf9b8B08A1454191A2334a0225aC663359816