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
disk_read: | |
;; store all register values | |
pusha | |
push dx | |
;; prepare data for reading the disk | |
;; al = number of sectors to read (1 - 128) | |
;; ch = track/cylinder number | |
;; dh = head number | |
;; cl = sector number |
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
{"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
// 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
#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
static void Binding(const FunctionCallbackInfo<Value>& args) { | |
Environment* env = Environment::GetCurrent(args); | |
Local<String> module = args[0]->ToString(env->isolate()); | |
node::Utf8Value module_v(env->isolate(), module); | |
Local<Object> cache = env->binding_cache_object(); | |
Local<Object> exports; | |
if (cache->Has(module)) { |
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
// Create a template for the global object and set the built-in global functions | |
Local<ObjectTemplate> global = ObjectTemplate::New(isolate); | |
global->Set( | |
String::NewFromUtf8(isolate, "log"), | |
FunctionTemplate::New(isolate, LogCallback) | |
); | |
// Each processor gets its own context so different processors do not affect each other | |
Persistent<Context> context = Context::New(isolate, NULL, global); |
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 } |