From: Felipe R. M. <fel...@gm...> - 2008-08-03 16:26:54
|
Now I get this: Exception in thread "main" jason.asSyntax.parser.TokenMgrError: Lexical error at line 3, column 54. Encountered: "\"" (34), after : "\\" at jason.asSyntax.parser.as2jTokenManager.getNextToken(as2jTokenManager.java:918) at jason.asSyntax.parser.as2j.jj_ntk(as2j.java:1697) at jason.asSyntax.parser.as2j.term(as2j.java:542) at jason.asSyntax.parser.as2j.terms(as2j.java:520) at jason.asSyntax.parser.as2j.pred(as2j.java:496) at jason.asSyntax.parser.as2j.literal(as2j.java:333) at jason.asSyntax.parser.as2j.term(as2j.java:549) at jason.asSyntax.parser.as2j.terms(as2j.java:520) at jason.asSyntax.parser.as2j.pred(as2j.java:496) at jason.asSyntax.parser.as2j.literal(as2j.java:333) at jason.asSyntax.parser.as2j.term(as2j.java:549) at jason.asSyntax.parser.as2j.terms(as2j.java:533) at jason.asSyntax.parser.as2j.pred(as2j.java:496) at jason.asSyntax.parser.as2j.literal(as2j.java:333) at jason.asSyntax.parser.as2j.belief(as2j.java:106) On Sat, Aug 2, 2008 at 8:48 AM, Jomi Hubner <hu...@em...> wrote: > Hi Felipe, you should 'escape' the internal ", as in > .add_plan("@obligationStart(.print(\"Hello\"))+now: true <- > .print(\"Hello\")."). > > Regards, > > Jomi > > > On Aug 1, 2008, at 8:12 PM, Felipe Rech Meneguzzi wrote: > > Hello All, > > I have been having problems with the .add_plan internal action, when I > try to add the following plan: > "@obligationStart(.print("Hello"))+now: true <- .print("Hello")." > > Getting the following error: > > [Plan] Error parsing plan @obligationStart(.print( > jason.asSyntax.parser.ParseException: Encountered "<EOF>" at line 1, column > 24. > Was expecting one of: > <VAR> ... > "true" ... > "false" ... > "~" ... > "begin" ... > "end" ... > <NUMBER> ... > <STRING> ... > <ATOM> ... > <UNNAMEDVAR> ... > "-" ... > "(" ... > "[" ... > > at jason.asSyntax.parser.as2j.generateParseException(as2j.java:1772) > at jason.asSyntax.parser.as2j.jj_consume_token(as2j.java:1652) > at jason.asSyntax.parser.as2j.term(as2j.java:574) > at jason.asSyntax.parser.as2j.terms(as2j.java:520) > at jason.asSyntax.parser.as2j.pred(as2j.java:496) > at jason.asSyntax.parser.as2j.literal(as2j.java:333) > at jason.asSyntax.parser.as2j.term(as2j.java:549) > at jason.asSyntax.parser.as2j.terms(as2j.java:520) > at jason.asSyntax.parser.as2j.pred(as2j.java:496) > at jason.asSyntax.parser.as2j.plan(as2j.java:215) > at jason.asSyntax.Plan.parse(Plan.java:116) > at jason.asSyntax.PlanLibrary.add(PlanLibrary.java:82) > at jason.stdlib.add_plan.execute(add_plan.java:93) > at > jason.asSemantics.TransitionSystem.applyExecInt(TransitionSystem.java:396) > at > jason.asSemantics.TransitionSystem.applySemanticRule(TransitionSystem.java:124) > at > jason.asSemantics.TransitionSystem.reasoningCycle(TransitionSystem.java:862) > at > jason.infra.centralised.CentralisedAgArch.run(CentralisedAgArch.java:196) > at java.lang.Thread.run(Thread.java:619) > > This seems to be caused by the code in the following line in > .add_plan.execute: > > Term plans = DefaultTerm.parse(args[0].toString()); > > Which results in plans being parsed to: "@obligationStart(.print(" > > Maybe I am doing things wrong here, but I believe the plan within the > string is perfectly valid. So assuming there is a problem when you try to > add plans which contain strings at some point, I will try to solve it and I > am trying to figure out how to sort this out, and when I do this, I will > gladly post the fixed code. > > If I did something wrong, I would appreciate it if someone pointed out > what. > > Regards, > > -- > ___________________________ > Felipe Rech Meneguzzi > fel...@gm... > http://fmeneguzzi.blogspot.com > ___________________________ > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________ > Jason-users mailing list > Jas...@li... > https://lists.sourceforge.net/lists/listinfo/jason-users > > > -- > Jomi Fred Hubner > ENS Mines Saint-Etienne > 158 Cours Fauriel > 42023 Saint-Etienne Cedex 02 > France > http://www.emse.fr/~hubner <http://www.emse.fr/%7Ehubner> > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Jason-users mailing list > Jas...@li... > https://lists.sourceforge.net/lists/listinfo/jason-users > > -- ___________________________ Felipe Rech Meneguzzi fel...@gm... http://fmeneguzzi.blogspot.com ___________________________ |