-
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.
- Loading branch information
1 parent
9c1ba99
commit 3fdef52
Showing
9 changed files
with
211 additions
and
74 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,10 @@ | ||
| ||
namespace Compiler | ||
{ | ||
public interface IParser | ||
{ | ||
List<ParserError> Errors { get; set; } | ||
|
||
List<ParserError> Parse(List<Lexeme> tokensList); | ||
} | ||
} |
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,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Compiler; | ||
|
||
public class DeclareParser : IParser | ||
{ | ||
private List<Lexeme> tokens; | ||
private Lexeme CurrToken; | ||
private int CurrIndex; | ||
private int MaxIndex; | ||
|
||
public List<ParserError> Errors { get; set; } | ||
|
||
public DeclareParser() | ||
{ | ||
Errors = new List<ParserError>(); | ||
} | ||
|
||
public List<ParserError> Parse(List<Lexeme> tokensList) | ||
{ | ||
Errors.Clear(); | ||
if (tokensList.Count <= 0) | ||
return Errors; | ||
tokens = tokensList; | ||
CurrIndex = 0; | ||
MaxIndex = tokensList.Count - 1; | ||
CurrToken = tokens[CurrIndex]; | ||
|
||
|
||
|
||
return Errors; | ||
} | ||
} |
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
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,6 +1,6 @@ | ||
DECLARE product_price CONSTANT INTEGER := +150; | ||
DECLARE expense_1_amount CONSTANT INTEGER := +50; | ||
DECLARE product_price CONSTANT INTEGER := -150; | ||
DECLARE product_price CONSTANT INTEGER = +150; | ||
DECLARE expense_1_amount CONSTANT INTEGER = +50; | ||
DECLARE product_price CONSTANT INTEGER = -150; | ||
|
||
DECLARE total_2 CONSTANT INTEGER:= 50; DECLARE productPrice3 CONSTANT INTEGER = +150; | ||
DECLARE total_2 CONSTANT INTEGER = 50; DECLARE productPrice3 CONSTANT INTEGER = +150; | ||
|
Oops, something went wrong.