ramkal.d
contains a so-and-so ready parser for the ISO variant of the Pascal language. It was mainly an experiment. I am done with it.
You can look at the source for influence, and ideas.
Note: Several additional constructs have been defined.
#!/usr/bin/env lua | |
function I(x) | |
return x | |
end | |
function K(x, y) | |
return x | |
end |
# Syntactic Grammar for ECMAScript | |
ecma-script-module ::= { top-level | ignorable } | |
top-level ::= statement | |
| function-declaration | |
| class-declaration | |
function-declaration ::= [ "async" ] "function" identifier function-params-postfix compound-statement |
ramkal.d
contains a so-and-so ready parser for the ISO variant of the Pascal language. It was mainly an experiment. I am done with it.
You can look at the source for influence, and ideas.
Note: Several additional constructs have been defined.
# Lexical and Syntactic EBNF Grammar for POSIX Shell (Non-Attributed) | |
# Authored by Chubak Bidpaa (chubakbidpaa@riseup.net) | |
# Written For the Marsh Shell (https://github.com/Chubek/Marsh) | |
# This grammar is based on POSIX specs (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html) | |
# This document is released under `Unlicense` Public Domain License Agreement | (C) 2024 Chubak Bidpaa | No Warranty | |
# A: Lexical Grammar for POSIX Shell | |
(* Formalism for ISO-7185:1990 "Pascal" Syntax *) | |
(* These will be extended into an AST *) | |
(* ISO Pascal is different from Delphi *) | |
(* Please submit your comments to chubakbidpaa [at] riseup [dot] net *) | |
type pas_kw = And | Array | Begin | Case | Const | |
| Div | Do | Downto | Else | End | |
| File | For | Function | Goto | |
| If | In | Label | Mod | Nil | |
| Not | Of | Or | Packed | Procedure |
In functional languages, and most modern imperative languages which implement functional features, we often have a map
function. In λ->
(simply-typed λ-calc
) we could describe the type of this function as:
Γ ⊢ λfλmα.m(α) : (A -> B) -> [A] -> Unit
Let me explain what this notation means.
I will use this Gist to post useful Scheme macros.
These macros will be compliant with R7Rs and down.
All macros are partially tested (warning!). Don't use them in serious work before thorough test.
#ifndef INTER_H | |
#define INTER_H | |
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
In Standard ML, we have two built-in functions called 'explode' and 'implode':
fun explode: string -> char list
fun implode: char list -> string
So, you get it, 'explode' makes a list of characters from a string and 'implode' does the inverse.
However, OCaml does not have these functions. Regardless; you may derive them like so:
This Gist contains a total of 5 tab-separated values files (TSV), and they list:
name;args;default;default arg values;flags;description
).Important thing to note is, these are the listings as defined by Ossanna and Kernighan. GNU additions have not been accounted for. Whatever Heirloom DocTools adds neither. This is pure ROFF!