0

so far I have been able to import the parser method as follows:

import * as Parser from "src / assets / 1erJison / myGramatica.js" and everything works great doing the following

**Parser.parse (input);**

However, in the semantic actions, I have definitions to build my tree and in the part of jison where I can enter code I have:

% {
  **function getTree () {
  return root;
}**

%}

so far Parser.getTree () doesn't work for me;

Could someone help me to do this, I use angular 10, thanks in advance

  • You should provide a [mre] if you expect an informed answer. But at least provide a hint about what `root` might be and why you think it's what you want your function to return. Extra points if you explain what it would mean for the function to "work for you". What do you expect it to do? What does it actually do? – rici Sep 03 '20 at 18:02
  • retorno un arbol ast construido con definiciones por la sintaxis, lo que pretendo es devolver la raís del árbol ast, ya pude devolverlo retornando el No Terminal Raiz con return $$, sin embargo ahora quiero poder enviar de la gramatica generada, los errores tanto léxicos como sintácticos a angular. – Mario Roberto Cojolón Shoc Sep 05 '20 at 05:31
  • Si sientes más cómodo en castellano, podrías poner tu pregunta en [es.so]. Sigo [tag:parsear] allá. – rici Sep 06 '20 at 00:37
  • If I understand your problem correctly, you should take a look at [this section of the jison docs](https://zaa.ch/jison/docs/#sharing-scope) – rici Sep 06 '20 at 01:42

0 Answers0