Problem calling the as parser directly


<div class=section1><br /><br /><p class=msonormal>i building asdoclet (similar java doclet) &#8220;.as&#8221;<br />files , in order parse &#8220;.as&#8221; files calling &#8220;macromedia.asc.parser.parser&#8221;<br />as shown below:<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal style='text-indent:4.5pt'>private static programnode<br />parse_asc(file file) throws ioexception {<o:p></o:p></p><br /><br /><p class=msonormal style='text-indent:4.5pt'>  context cx = new<br />context(new contextstatics());<o:p></o:p></p><br /><br /><p class=msonormal>    bytearrayinputstream in =<br />getinputstream(file);<o:p></o:p></p><br /><br /><p class=msonormal>    cx.setscriptname(file.getname());<o:p></o:p></p><br /><br /><p class=msonormal>    cx.setpath(file.getparent());<span<br />lang=fr><o:p></o:p></span></p><br /><br /><p class=msonormal><span lang=fr><o:p> </o:p></span></p><br /><br /><p class=msonormal><span lang=fr>    parser parser = new parser(cx,<o:p></o:p></span></p><br /><br /><p class=msonormal><span lang=fr>                              <br /></span>in,<o:p></o:p></p><br /><br /><p class=msonormal>                              <br />file.getabsolutepath().replace('\\', '/'),<o:p></o:p></p><br /><br /><p class=msonormal>                              <br />true, // emit doc info<o:p></o:p></p><br /><br /><p class=msonormal>                              <br />true); // save comment nodes<o:p></o:p></p><br /><br /><p class=msonormal>    return parser.parseprogram();<o:p></o:p></p><br /><br /><p class=msonormal>  }<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>the parser can found here:<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal><a<br />href="http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/modules/asc/src/java/ma cromedia/asc/parser/parser.java">http://opensource.adobe.com/svn/opensource/flex/sdk/trunk /modules/asc/src/java/macromedia/asc/parser/parser.java</a><o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>my problem parses fine in sdk , my<br />files *<b>except</b>* expressions in class:<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>public static const top_left:int = (0x0001 | 0x0004);<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>the error parser is:<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>        embedded error:<br />bitwiseor @ line &#8230;<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>does have an  idea why may getting<br />this problem? there better (cleaner) way set parser use it<br />externally this?<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>thanks in advance can provide.<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /><p class=msonormal>julian payne<o:p></o:p></p><br /><br /><p class=msonormal>ilog s.a.<o:p></o:p></p><br /><br /><p class=msonormal><o:p> </o:p></p><br /><br /></div>

how invoking it? can't parse sub elements individually--you need whole tree starting programnode.

also, need init correctly, fresh context, etc. hard without knowing how use it.

jono


on sep 3, 2008, @ 3:22 am, "julian payne" < member@adobeforums.com> wrote:

a new discussion started julian payne in



developers --

  problem calling parser directly







i building asdoclet (similar java doclet) â.asâ
files , in order parse â.asâ files calling âmacromedia.asc.parser.parserâ
as shown below:



 



private static programnode
parse_asc(file file) throws ioexception {



  context cx = new
context(new contextstatics());



    bytearrayinputstream in =
getinputstream(file);



    cx.setscriptname(file.getname());



    cx.setpath(file.getparent());



 



    parser parser = new parser(cx,



                              
in,



                              
file.getabsolutepath().replace('\\', '/'),



                              
true, // emit doc info



                              
true); // save comment nodes



    return parser.parseprogram();



  }



 



the parser can found here:



 



http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/modules/asc/src/java/macromedia/ asc/parser/parser.java http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/modules/asc/src/java/macromedia/ asc/parser/parser.java



 



my problem parses fine in sdk ,
files * except* expressions in class:



 



public static const top_left:int = (0x0001 | 0x0004);



 



the error parser is:



 



        embedded error:
bitwiseor @ line â¦



 



does have an  idea why may getting
this problem? there better (cleaner) way set parser use
externally this?



 



thanks in advance can provide.



 



julian payne



ilog s.a.



 











view/reply @ problem calling parser directly

replies email ok.

use unsubscribe form cancel email subscription.




More discussions in Developers


adobe

Comments

Popular posts from this blog

Static ip - Raspberry Pi Forums

arduino bug sur secteur, batterie, mais pas en usb?

What voltage is sent to the arduino GND when a transistor is used