AS3Parser implements IAS3Parser { public final IParserNode buildAst( final String filePath ) throws IOException, TokenException { return parseLines( filePath, FileUtils.readLines( new File( filePath ) ) ); } AS3Parser(); final IParserNode buildAst( final String filePath ); final IParserNode buildAst( final String filePath,
                                      final String[] scriptBlockLines ); static final String ASDOC_COMMENT; static final String MULTIPLE_LINES_COMMENT; static final String NEW_LINE; static final String SINGLE_LINE_COMMENT; }
@Test public void testBuildAst() throws IOException, URISyntaxException, TokenException { asp.buildAst( getClass().getResource( "/examples/unformatted/IContext.as" ).toURI().getPath() ); asp.buildAst( getClass().getResource( "/examples/FlexPMD115.as" ).toURI().getPath() ); asp.buildAst( getClass().getResource( "/examples/JPEGEncoder.as" ).toURI().getPath() ); asp.buildAst( getClass().getResource( "/examples/JPEGEncoder2.as" ).toURI().getPath() ); asp.buildAst( getClass().getResource( "/examples/FisheyeBase.as" ).toURI().getPath() ); asp.buildAst( getClass().getResource( "/examples/FlexPMD98.as" ).toURI().getPath() ); asp.buildAst( getClass().getResource( "/examples/FlexPMD195.as" ).toURI().getPath() ); final String titlePath = getClass().getResource( "/examples/unformatted/Title.as" ).toURI().getPath(); asp.buildAst( titlePath ); asp.buildAst( titlePath, FileUtils.readLines( new File( titlePath ) ) ); }
@Test public void testBuildAst_AS2() throws IOException, URISyntaxException, TokenException { asp.buildAst( getClass().getResource( "/examples/toAS2/src/fw/data/request/ResultListener.as" ) .toURI() .getPath() ); asp.buildAst( getClass().getResource( "/examples/toAS2/src/epg/StateExit_AS2.as" ).toURI().getPath() ); }
@Test public void testBuildAst2() throws IOException, TokenException, URISyntaxException { final IParserNode flexPmd62 = asp.buildAst( getClass().getResource( "/examples/FlexPMD62.as" ) .toURI() .getPath() ); assertEquals( "com.test.testy.ui.components", flexPmd62.getChild( 0 ).getChild( 0 ).getStringValue() ); }