12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import {
- InputStream,
- CommonTokenStream
- } from 'antlr4/index';
- import * as Commands from './ast/commands';
- import { IVProgParser } from './ast/ivprogParser';
- import Lexers from '../grammar/';
- import { IVProgProcessor } from './processor/ivprogProcessor';
- const lang = 'pt_br';
- const ivprogLexer = Lexers[lang];
- const input = `programa {
-
- funcao inicio() {
- inteiro a[2] = {1,2}
- }
- }`;
- const anaSin = new IVProgParser(input, ivprogLexer);
- const proc = new IVProgProcessor(anaSin.parseTree());
- proc.interpretAST().then( sto => {
- console.log(sto.applyStore('a'));
- }).catch(e => console.log(e));
-
|