Sha256: ef73d2e0ce2a2fdb80c19b3e39de59dd93beb1cf686f0938e74ab9f436178f0d

Contents?: true

Size: 1.62 KB

Versions: 97

Compression:

Stored size: 1.62 KB

Contents

# Forth

Implement an evaluator for a very simple subset of Forth.

[Forth](https://en.wikipedia.org/wiki/Forth_%28programming_language%29)
is a stack-based programming language. Implement a very basic evaluator
for a small subset of Forth.

Your evaluator has to support the following words:

- `+`, `-`, `*`, `/` (integer arithmetic)
- `DUP`, `DROP`, `SWAP`, `OVER` (stack manipulation)

Your evaluator also has to support defining new words using the
customary syntax: `: word-name definition ;`.

To keep things simple the only data type you need to support is signed
integers of at least 16 bits size.

You should use the following rules for the syntax: a number is a
sequence of one or more (ASCII) digits, a word is a sequence of one or
more letters, digits, symbols or punctuation that is not a number.
(Forth probably uses slightly different rules, but this is close
enough.)

Words are case-insensitive.

## Hints
- To parse the text, you could try to use the [Sprache](https://github.com/sprache/Sprache/blob/develop/README.md) library. You can also find a good tutorial [here](https://www.thomaslevesque.com/2017/02/23/easy-text-parsing-in-c-with-sprache/).


### Submitting Exercises

Note that, when trying to submit an exercise, make sure the exercise file that you're submitting is in the `exercism/csharp/<exerciseName>` directory.

For example, if you're submitting `bob.cs` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/csharp/bob/bob.cs`.

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

Version data entries

97 entries across 97 versions & 1 rubygems

Version Path
trackler-2.2.1.103 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.102 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.101 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.100 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.99 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.98 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.97 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.96 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.95 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.94 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.93 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.92 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.91 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.90 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.89 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.88 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.87 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.86 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.85 tracks/csharp/exercises/forth/README.md
trackler-2.2.1.84 tracks/csharp/exercises/forth/README.md