-
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.
Merge pull request #2 from Denis-Olejnik/dev
Lexical & syntax (AST) analyzers is released!
- Loading branch information
Showing
16 changed files
with
636 additions
and
113 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
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
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
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 |
---|---|---|
@@ -1,21 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace LexicalAnalyzer.LexicalAnalyzer.Source | ||
namespace LexicalAnalyzer.LexicalAnalyzer.Source | ||
{ | ||
// TODO: Replace text type with enum? | ||
// This may be more convenient than the current implementation. | ||
// Address/search by type (.Semicolon, ,Variable) , but display static name in DataGridTable. | ||
|
||
|
||
|
||
public class Lex | ||
{ | ||
public readonly string lexemType; | ||
public readonly string lexemWord; | ||
public Lex(string lexemType, string lexemWord) | ||
public readonly Type type; | ||
public readonly string word; | ||
|
||
public enum Type | ||
{ | ||
this.lexemType = lexemType; | ||
this.lexemWord = lexemWord; | ||
Assign, // := | ||
Colon, // : | ||
Comment_Open, // { | ||
Comment_Close, // } | ||
End, // . | ||
Logical_AND, // and | ||
Logical_NOT, // not | ||
Logical_OR, // or | ||
Logical_XOR, // xor | ||
Parenthesis, // () | ||
Semicolon, // ; | ||
Condition, // true/false | ||
Constant, // const | ||
Variable, // variable | ||
Null, // null-value | ||
} | ||
|
||
public Lex(Type _lexemType, string _lexemWord) | ||
{ | ||
this.type = _lexemType; | ||
this.word = _lexemWord; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.