@panini-lang/core

Panini - the Indian programming language.

Usage no npm install needed!

<script type="module">
  import paniniLangCore from 'https://cdn.skypack.dev/@panini-lang/core';
</script>

README

Panini - Indian programming language

Requirements

  1. NodeJS (version >= 16.0.0)
  2. npm (version >= 7.18.1)
  3. TypeScript (version >= 4.3.4)

Working with Panini

  1. Install globally using
$ npm install -g @panini-lang/core
  1. Usage
$ panini <file name>

Adding support for new Indian language

  1. Add language to src/language.ts
  2. Create file with language's name under src/rules directory. For example, to add support for the తెలుగు (Telugu) language, create file src/rules/తెలుగు.ts.
    Note: the file's name should match with the enum added in step 1.
  3. 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 for TokenType.ModuleStart such that it creates well-known action and goto table entries. Read the parse function's comments in src/parser.ts for more details.
  4. Import the rules created above in src/rules.ts
  5. Export the rules created above from src/index.ts
  6. Add rules created above to src/firstSet.ts
  7. Add appropriate syntax error messages in src/errors/syntaxError.ts and semantic analysis steps in src/parser.ts
  8. Add correct steps for transpilation under src/transpiler.ts
  9. Run tests.
$ npm test
  1. Add thorough tests in the required spec.ts files and verify no existing tests are broken. Create new test files if required.
  2. Make sure all the tests pass. AGAIN.
  3. Do NOT push changes directly to main branch.
  4. Submit a pull request to the main branch.