-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
943 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
*.vsix | ||
|
||
.DS_Store | ||
.vscode | ||
test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Change Log | ||
|
||
All notable changes to the "e15-syntax-highlighter" extension will be documented in this file. | ||
|
||
<!-- ## [Unreleased] --> | ||
|
||
## [1.0.0] 2023-02-05 | ||
|
||
- Initial release |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# E15 Syntax Highlighter | ||
A TextMate Grammar based syntax highlighter for NYU's pedagogical ISA, E15. | ||
|
||
\!\[highlit\]\(images/example.png\) | ||
|
||
## Requirements | ||
|
||
1. Text editor that supports TextMate Grammar, such as VS Code. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* OPCODE SRC DST IMMDATA */ | ||
myROM[0] = {jmp, RXX, RXX, 4'b0000}; | ||
myROM[1] = {jz, RXX, RXX, 4'b0000}; | ||
myROM[2] = {jnz, RXX, RXX, 4'b0000}; | ||
myROM[3] = {mov, Rg0, Rg1, 4'b0000}; | ||
myROM[4] = {movi, RXX, Rg0, 4'b0001}; | ||
myROM[6] = {add, Rg2, Rg3, 4'b0000}; | ||
myROM[5] = {addi, RXX, Rg1, 4'b0010}; | ||
myROM[7] = {sub, Rg0, Rg1, 4'b0000}; | ||
myROM[8] = {subi, RXX, Rg2, 4'b0011}; | ||
myROM[9] = {cmp, Rg2, Rg3, 4'b0000}; | ||
myROM[10] = {cmpi, RXX, Rg3, 4'b0100}; | ||
myROM[11] = {jmp, RXX, RXX, 4'b0000}; | ||
myROM[12] = {jmp, RXX, RXX, 4'b0000}; | ||
myROM[13] = {jmp, RXX, RXX, 4'b0000}; | ||
myROM[14] = {jmp, RXX, RXX, 4'b0000}; | ||
myROM[15] = {jmp, RXX, RXX, 4'b0000}; | ||
|
||
/* | ||
|
||
This program does nothing but prove that | ||
my syntax highlighter is functional | ||
|
||
- Rishyak | ||
|
||
*/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"comments": { | ||
// symbol used for single line comment. Remove this entry if your language does not support line comments | ||
"lineComment": "//", | ||
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments | ||
"blockComment": [ "/*", "*/" ] | ||
}, | ||
// symbols used as brackets | ||
"brackets": [ | ||
["{", "}"], | ||
["[", "]"], | ||
], | ||
// symbols that are auto closed when typing | ||
"autoClosingPairs": [ | ||
["{", "};"], | ||
["[", "]"], | ||
], | ||
// symbols that can be used to surround a selection | ||
"surroundingPairs": [ | ||
["{", "}"], | ||
["[", "]"], | ||
], | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "e15-syntax-highlighter", | ||
"displayName": "E15 Syntax Highlighter", | ||
"description": "Syntax highlighter for NYU's pedagogical ISA, E15", | ||
"version": "1.0.0", | ||
"author": { | ||
"name": "Rishyak", | ||
"email": "[email protected]" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/rishyak/extention15" | ||
}, | ||
"main": "src/extension", | ||
"activationEvents": [ | ||
"onLanguage:e15" | ||
], | ||
"engines": { | ||
"vscode": "^1.75.0" | ||
}, | ||
"categories": [ | ||
"Programming Languages" | ||
], | ||
"contributes": { | ||
"languages": [ | ||
{ | ||
"id": "e15", | ||
"aliases": [ | ||
"E15", | ||
"e15" | ||
], | ||
"extensions": [ | ||
".v", | ||
".e15" | ||
], | ||
"configuration": "./language-configuration.json" | ||
} | ||
], | ||
"grammars": [ | ||
{ | ||
"language": "e15", | ||
"scopeName": "source.e15", | ||
"path": "./syntaxes/e15.tmLanguage.json" | ||
} | ||
] | ||
}, | ||
"devDependencies": { | ||
"js-yaml": "^4.1.0" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alert("E15 Syntax Highlighting") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "E15", | ||
"patterns": [ | ||
{ | ||
"include": "#comment" | ||
}, | ||
{ | ||
"include": "#rom" | ||
}, | ||
{ | ||
"include": "#opcode" | ||
}, | ||
{ | ||
"include": "#registers" | ||
}, | ||
{ | ||
"include": "#numbers" | ||
} | ||
], | ||
"repository": { | ||
"comment": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.block.e15", | ||
"begin": "/\\*", | ||
"end": "\\*/" | ||
}, | ||
{ | ||
"name": "comment.line.e15", | ||
"begin": "//", | ||
"end": "\\n" | ||
} | ||
] | ||
}, | ||
"rom": { | ||
"patterns": [ | ||
{ | ||
"name": "storage.name.myrom.e15", | ||
"match": "\\b(myROM)\\b" | ||
} | ||
] | ||
}, | ||
"opcode": { | ||
"patterns": [ | ||
{ | ||
"name": "markup.quote.opcode.e15", | ||
"match": "\\b(jmp|jz|jnz|mov|movi|add|addi|sub|subi|cmp|cmpi)\\b" | ||
} | ||
] | ||
}, | ||
"registers": { | ||
"patterns": [ | ||
{ | ||
"name": "variable.parameter.registers.e15", | ||
"match": "\\b(RXX|Rg[0-3])\\b" | ||
} | ||
] | ||
}, | ||
"numbers": { | ||
"patterns": [ | ||
{ | ||
"name": "constant.numeric.immediate.e15", | ||
"match": "(4'b\\d{4})" | ||
}, | ||
{ | ||
"name": "constant.numeric.rom.e15", | ||
"match": "(\\d{1,2})" | ||
} | ||
] | ||
} | ||
}, | ||
"scopeName": "source.e15" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
$schema: https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json | ||
name: E15 | ||
patterns: | ||
- include: "#comment" | ||
- include: "#rom" | ||
- include: "#opcode" | ||
- include: "#registers" | ||
- include: "#numbers" | ||
repository: | ||
comment: | ||
patterns: | ||
- name: comment.block.e15 | ||
begin: /\* | ||
end: \*/ | ||
- name: comment.line.e15 | ||
begin: // | ||
end: \n | ||
rom: | ||
patterns: | ||
- name: storage.name.myrom.e15 | ||
match: \b(myROM)\b | ||
opcode: | ||
patterns: | ||
- name: markup.quote.opcode.e15 | ||
match: \b(jmp|jz|jnz|mov|movi|add|addi|sub|subi|cmp|cmpi)\b | ||
registers: | ||
patterns: | ||
- name: variable.parameter.registers.e15 | ||
match: \b(RXX|Rg[0-3])\b | ||
numbers: | ||
patterns: | ||
- name: constant.numeric.immediate.e15 | ||
match: (4'b\d{4}) | ||
- name: constant.numeric.rom.e15 | ||
match: (\d{1,2}) | ||
scopeName: source.e15 |