nblumhardt / tcalc

A series of C# parser construction examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tcalc

A series of C# parser construction examples, using Superpower.

This repository implements a toy language for simple calculations over durations expressed in days (d), hours (h), minutes (m), seconds (s), or milliseconds (ms), along with floating point numbers:

tcalc> (1h - 50m) * 3
00:30:00

tcalc> 7d / 350ms
1728000

The master branch implements this as a token-driven parser. You can also view the parser expressed as a pure-text parser by switching to the text-parser branch.

About

A series of C# parser construction examples

License:Apache License 2.0


Languages

Language:C# 100.0%