This project is read-only.

Project Description

Simple Script is a simple implementation of an interpreter language built with GPlex and Gppg (Lex/Yacc). It's developed in C#.

This project is a student project for the "Compilers" course held by Prof. Ashot Vasilyan at the IT Eduaction and Research Center at the Yerevan State University.

More info on GPLEX here (
More info on GPPG here (
In-order to make things rolling you need to download the GPLEX and GPPG distros from the links above.

Useful Links
Creating a Lexer for C#


The project file SimpleScript.Analyzing.csproj is customized to build the scanner and parser with gplex and gppg automatically when the Lex or Yacc files are modified.
In-order to make this working the paths to gplex.exe and gppg.exe must be added to your PATH environmental variable. And also to built the project you need to check-out the whole SimpleScript.Analyzing project, in-order not to get file permission/lock errors.

An example of a SimpleScript calculating the Greatest Common Divisor

Dim $a As int
Dim $b As int
Dim $t As int

Print "Welcome To GCD !!!"

Print "Input a:"
Input $a
Print "Input b:"
Input $b

While ($b!=0) Do
$b=$a % $b
Print "The GCD is:"
Print $a

Stuff Implemented

  • int
  • double
  • string
  • bool

Program Start and End
  • Begin <statements> End

Variable Declaration
  • Dim <Identifier> As <int, double, string, bool>

  • Assignment =
  • Add +
  • Minus -
  • Mul *
  • Div /
  • Modul %
  • And and (not yet implemented)
  • Or or (not yet implemented)
  • Not not (not yet implemented)
  • Equal ==
  • Not Equal !=
  • Little <
  • Great >
  • Great or Equal >= (not yet implemented)
  • Little or Equal <= (not yet implemented)

Input/Print Statements
*Input <Ident>
*Print <Expr>

  • : For (<ident>=<expr>) To <expr>
  • : While (<Expr>) Do
<Statement List>
Conditional Statements
  • : If (<Expr>) Then
<Statement List>
Else (else may not be present)
<Statement List>

Last edited Jan 10, 2011 at 9:20 PM by tigrantopchyan, version 7