Skip to content
A programming language interpreter written in Free Pascal
Pascal
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Ch16
gearlib
lexer-parser
GearLang - An interpreter in Free Pascal - external visitor pattern.pdf
README.md
The Gear language description.pdf
gear
gear.lpi
gear.lpr
gear.lps
helloWorld.gear
uArray.pas
uArrayIntf.pas
uCallable.pas
uClass.pas
uClassIntf.pas
uDict.pas
uDictIntf.pas
uEnum.pas
uEnumIntf.pas
uFunc.pas
uMembers.pas
uMemory.pas
uResolver.pas
uVariantSupport.pas
uarray.pas
uarrayintf.pas
uast.pas
ucallable.pas
uclass.pas
uclassintf.pas
ucollections.pas
udict.pas
udictintf.pas
uenum.pas
uenumintf.pas
uerror.pas
ufunc.pas
uhash.pas
uinterpreter.pas
ulanguage.pas
ulexer.pas
umath.pas
umembers.pas
umemory.pas
uparser.pas
uprinter.pas
ureader.pas
uresolver.pas
ustandard.pas
ustandardcrt.pas
ustandardfiles.pas
ustandardlist.pas
utils_.pas
utoken.pas
utuple.pas
utupleintf.pas
uvisitor.pas

README.md

GearLanguage

A programming language interpreter written in Free Pascal. See the PDF included for more information about the Gear language. It also includes 16 chapters that explain exactly (including code) how the language evolved. In the appendix a description of the language is available. Gear is a multi-paradigm language: procedural, object-oriented and functional with closures and anonymous functions. It is dynamic without type annotation, but still strongly typed. Variables cannot change type! Currently, it is only an interpreter, but there are plans to create a compiler as well.

The examples from chapter 16 of the book can be found in the Ch16 folder. The executable is built on MacOs Mojave and is named gear. To execute a file with name 'helloWorld.gear':

gear -x -f helloWorld.gear

To print the AST:

gear -a -f helloWorld.gear

It is important to copy the /gearlib folder, as it contains part of the RTL. Include 'use system' in your code to fully use the RTL.

To create executables for Windows or Linux, compile the project with Lazarus/Free Pascal (v 3.04), in the respective OS.

You can’t perform that action at this time.