Skip to content

Instantly share code, notes, and snippets.

@atoone
atoone / example_output.txt
Created Jan 7, 2019
Quick 'n tidy Hex Dump method
View example_output.txt
- 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 6425 a19c 0001 0003 0000 0000 5554 0500 d%??........UT..
- 011c 2f38 53 ../8S
@atoone
atoone / Expression Parser.java
Last active Dec 1, 2015
Precedence-climbing expression parser declared in a fluent Java style. Note the parsers handle user defined tokens (Token.java) which allows additional meta information to be handled cleanly. The AST is converted into POJOs using annotations that support path-like identifiers, automatic type conversion and discovery of leaf nodes based on type.
View Expression Parser.java
/**
* This is a parser for the precedence climbing grammar:
*
* E --> Exp(0)
* Exp(p) --> P {B Exp(q)}
* P --> U Exp(q) | "(" E ")" | v
* B --> "+" | "-" | "*" |"/" | "^" | "||" | "&&" | "="
* U --> "-"
*
* Where successive B are selected according to the precedence p of the parameterized expression Exp(p).
You can’t perform that action at this time.