Skip to content

An ongoing C Sharp Compiler project inspired from a code analysis project by Microsoft for its .NET Compiler Platform ("Roslyn")

Notifications You must be signed in to change notification settings

WideSu/cSharpCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Compiler

An ongoing Compiler project built using C#.

Phase 1: Lexer and Parser

Can parse binary expressions with parenthesis, return the result with error message and parser tree.

You can use #showTree to close or open printing parser tree. And use #cls to clear the screem.

1 + 3 * 5

16

(1 + 3) * 5

20

1 + 3 3

Result

└──BinaryExpression
    ├──LiteralExpression
    |   └──LiteralToken 1
    ├──PlusToken
    ├──LiteralExpression
        └──LiteralToken 3
ERROR: Unexpected token <NumberToken>, expected <EndOfFileToken>

Phase 2: Unary operator & Conditional statement

About

An ongoing C Sharp Compiler project inspired from a code analysis project by Microsoft for its .NET Compiler Platform ("Roslyn")

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages