README
Panini - Indian programming language
Requirements
- NodeJS (version >= 16.0.0)
- npm (version >= 7.18.1)
- TypeScript (version >= 4.3.4)
Working with Panini
- Install globally using
$ npm install -g @panini-lang/core
- Usage
$ panini <file name>
Adding support for new Indian language
- Add language to
src/language.ts
- Create file with language's name under
src/rules
directory. For example, to add support for theతెలుగు
(Telugu) language, create filesrc/rules/తెలుగు.ts
.
Note: the file's name should match with the enum added in step 1. - Add the syntax rules in the file created above. Rules map should be named like
<language>_RulesMap
. Forతెలుగు
it should be namedతెలుగు_RulesMap
.
Note: be careful to add the rule forTokenType.ModuleStart
such that it creates well-knownaction
andgoto
table entries. Read theparse
function's comments insrc/parser.ts
for more details. - Import the rules created above in
src/rules.ts
- Export the rules created above from
src/index.ts
- Add rules created above to
src/firstSet.ts
- Add appropriate syntax error messages in
src/errors/syntaxError.ts
and semantic analysis steps insrc/parser.ts
- Add correct steps for transpilation under
src/transpiler.ts
- Run tests.
$ npm test
- Add thorough tests in the required
spec.ts
files and verify no existing tests are broken. Create new test files if required. - Make sure all the tests pass. AGAIN.
- Do NOT push changes directly to
main
branch. - Submit a pull request to the
main
branch.