From: Burak K. <bbu...@gm...> - 2024-01-16 13:59:11
|
Hi Jomi, I used the Structure.parse to get the left and right side of the expression and getFunctor to get the operator. I created a tree structure from there, but it makes me feel like I just created an overhead. Is there a direct access to the parse tree? Thank you. Best regards Burak Karaduman <bbu...@gm...>, 12 Oca 2024 Cum, 13:20 tarihinde şunu yazdı: > Hi Jomi, > > Thank you for your reply. > > Should I begin with such a way: > String inputString = f&(a|b)|c&(d|e); > as2j parser = new as2j(new StringReader(inputString)); > Term t = parser.term(); > if (t instanceof ClassA) > ..... > > If so, the parser does not generate a tree, and maybe I am missing > something. > > Thank you so much. > > Best regards. > > Jomi Hubner <jom...@gm...>, 11 Oca 2024 Per, 18:21 tarihinde şunu > yazdı: > >> > On 11 Jan 2024, at 09:57, Burak Karaduman <bbu...@gm...> >> wrote: >> > >> > Hi Jomi, >> > >> > Thank you so much for your help. It is what I needed, and It worked >> with a bit of modification. >> > >> > But, also I need help with parsing the logical context of a plan, I can >> access the plan's context but, specifically, it is needed to get the >> execution sequence such as: >> > >> > +!planA: ((((speed(60) & temp(40)) | humidity (13) ) | angle (125)) -> >> I assume this context is parsed and it gives an execution sequence based on >> the parentheses, operators and operands. >> >> yes! >> >> > >> > Is there a way to access that kind of stack or list mechanism? >> >> yes, but it is more like a tree (instead of a stack). You have to check >> the classes of the context, for instance, it could be LogExpr that >> represents “&” and “|”, RelExpr for “>” ... see classes at >> https://jason-lang.github.io/api/jason/asSyntax/package-summary.html. >> >> >> HTH, >> >> Jomi > > > > -- > > *Burak KARADUMAN,* > Ph.D. Student at the University of Antwerp & Flanders Make, > Modeling Intelligent Complex Software & Systems (MICSS-Lab), > *G236, Department of **Computer Science**, Faculty of Science, Campus > Middelheim,* > Middelheimlaan 1, 2020 Antwerp, Belgium > > -- *Burak KARADUMAN,* Ph.D. Student at the University of Antwerp & Flanders Make, Modeling Intelligent Complex Software & Systems (MICSS-Lab), *G236, Department of **Computer Science**, Faculty of Science, Campus Middelheim,* Middelheimlaan 1, 2020 Antwerp, Belgium |