This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package me.lachlanap | |
| import scala.language.postfixOps | |
| //noinspection ForwardReference | |
| //noinspection VariablePatternShadow | |
| object LanguageParser { | |
| import Ast._ | |
| import fastparse.all._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val digitToStringLambda = makeMatch( | |
| makeCase(pattern(num(0)), str("0")), | |
| makeCase(pattern(num(1)), str("1")), | |
| makeCase(pattern(num(2)), str("2")), | |
| makeCase(pattern(num(3)), str("3")), | |
| makeCase(pattern(num(4)), str("4")), | |
| makeCase(pattern(num(5)), str("5")), | |
| makeCase(pattern(num(6)), str("6")), | |
| makeCase(pattern(num(7)), str("7")), | |
| makeCase(pattern(num(8)), str("8")), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module me.lachlanap.file_average { | |
| process Main() :: EntryPoint { | |
| main = args => { | |
| // ::ProcessHandle[Sink[Int]] | |
| out = \Sink[Int] { | |
| main = nothing | |
| } | |
| accumulator :: ProcessHandle[CloseableSink[Int]] = new Accumulator(out) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package me.lachlanap.timetrackerii | |
| object Main { | |
| def main(args: Array[String]): Unit = { | |
| println("Hello World") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # A script to print a random sequence of alphanumeric and \n characters. | |
| cat /dev/urandom | tr -cd '[:alnum:]\n' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # A script to print a random sequence of alphanumeric and \n characters. | |
| cat /dev/urandom | tr -cd '[:alnum:]\n' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Models a Function Dependency. | |
| * | |
| * Example: | |
| * A, B -> C would be: FD(Set("A", "B"), Set("C")) | |
| */ | |
| case class FD(lhs: Set[String], rhs: Set[String]) { | |
| if (lhs.size == 0 || rhs.size == 0) | |
| throw new IllegalArgumentException("Cannot be null FD") | |