This file contains 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
{ | |
"[dockerfile]": { | |
"editor.defaultFormatter": "ms-azuretools.vscode-docker" | |
}, | |
"[javascript]": { | |
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | |
}, | |
"[typescript]": { | |
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | |
}, |
This file contains 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
{ | |
"env": { | |
"commonjs": true, | |
"es6": true, | |
"jest": true, | |
"node": true | |
}, | |
"extends": [ | |
"eslint:all", | |
"plugin:@typescript-eslint/all", |
This file contains 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
Show hidden characters
{ | |
"$schema": "https://json.schemastore.org/tsconfig", | |
"compilerOptions": { | |
"allowUnreachableCode": false, | |
"alwaysStrict": true, | |
"composite": true, | |
"declaration": true, | |
"declarationMap": true, | |
"esModuleInterop": true, | |
"forceConsistentCasingInFileNames": true, |
This file contains 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
// Feel free to change this constant and Run the playground | |
// It will emit assembly into Logs tab to your right | |
const EXPRESSION_TO_COMPILE = "5 + 10 * 10"; | |
// Tokens | |
enum TokenType { NUMBER, PLUS, MINUS, STAR, SLASH, LEFT_PAREN, RIGHT_PAREN, EOF } | |
interface Token { type: TokenType, value: string } | |
// Lexical Analysis | |
class Scanner { |
This file contains 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
{"lastUpload":"2020-08-06T14:04:38.018Z","extensionVersion":"v3.4.3"} |
This file contains 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
#ifndef COOL_TREE_H | |
#define COOL_TREE_H | |
////////////////////////////////////////////////////////// | |
// | |
// file: cool-tree.h | |
// | |
// This file defines classes for each phylum and constructor | |
// | |
////////////////////////////////////////////////////////// |
This file contains 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
/* | |
* cool.y | |
* Parser definition for the COOL language. | |
* | |
*/ | |
%{ | |
#include <iostream> | |
#include "cool-tree.h" | |
#include "stringtab.h" | |
#include "utilities.h" |
This file contains 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
%{ | |
#include <cool-parse.h> | |
#include <stringtab.h> | |
#include <utilities.h> | |
#include <string.h> | |
#define yylval cool_yylval | |
#define yylex cool_yylex | |
#define MAX_STR_CONST 1025 | |
#define YY_NO_UNPUT /* keep g++ happy */ |
This file contains 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
$ tsc --target es6 --module commonjs wix.ts && node wix.js | |
---serialize--- | |
13,A,9,12;9,B,5,8;5,C,0,4;0,0,0,0;4,E,1,2;1,0,0,0;2,0,0,0;8,P,5,6;5,0,0,0;6,0,0,0;12,G,9,10;9,0,0,0;10,0,0,0 | |
---deserialize--- | |
BinaryTree { | |
root: BinaryNode { | |
value: 'A', | |
left: BinaryNode { value: 'B', left: [BinaryNode], right: [BinaryNode] }, | |
right: BinaryNode { value: 'G', left: null, right: null } |
This file contains 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 | |
(type $t0 (func)) | |
(type $t1 (func (param i32 i32) (result i32))) | |
(import "main" "sayHello" (func $main.sayHello (type $t0))) | |
(func $add (export "add") (type $t1) (param $p0 i32) (param $p1 i32) (result i32) | |
get_local $p0 | |
get_local $p1 | |
i32.add) | |
(func $f2 (type $t0) | |
call $main.sayHello) |
NewerOlder