Package com.adobe.ac.pmd.parser

Examples of com.adobe.ac.pmd.parser.IParserNode


   }

   private String extractEventNameFromConstructor( final IFunction constructor )
   {
      String eventName = "";
      final IParserNode superCall = constructor.getSuperCall();

      if ( superCall != null )
      {
         eventName = superCall.getChild( 1 ).getChild( 0 ).getStringValue();
      }
      return eventName;
   }
View Full Code Here


   private void findViolationsInLocalVariables( final IFunction function )
   {
      for ( final Entry< String, IParserNode > localVariableEntry : function.getLocalVariables().entrySet() )
      {
         final IParserNode type = getTypeFromFieldDeclaration( localVariableEntry.getValue() );

         tryToAddViolation( type,
                            type.getStringValue() );
      }
   }
View Full Code Here

    * @return
    * @throws PMDException
    */
   public static IParserNode buildAst( final IFlexFile file ) throws PMDException
   {
      IParserNode rootNode = null;

      try
      {
         rootNode = tryToBuildAst( file );
      }
View Full Code Here

      {
         final IFlexFile file = fileEntry.getValue();

         try
         {
            final IParserNode node = buildThreadedAst( file );

            asts.put( file.getFullyQualifiedName(),
                      NodeFactory.createPackage( node ) );
         }
         catch ( final InterruptedException e )
View Full Code Here

   }

   private static IParserNode tryToBuildAst( final IFlexFile file ) throws IOException,
                                                                   TokenException
   {
      IParserNode rootNode;
      final IAS3Parser parser = new AS3Parser();
      if ( file instanceof IMxmlFile )
      {
         rootNode = parser.buildAst( file.getFilePath(),
                                     ( ( IMxmlFile ) file ).getScriptBlock() );
View Full Code Here

    * @param functionNode
    * @return
    */
   protected static IParserNode getNameFromFunctionDeclaration( final IParserNode functionNode )
   {
      IParserNode nameChild = null;

      for ( final IParserNode child : functionNode.getChildren() )
      {
         if ( child.is( NodeKind.NAME ) )
         {
View Full Code Here

    * @param function
    * @return the added violation positioned on the given function node
    */
   protected final IFlexViolation addViolation( final IFunction function )
   {
      final IParserNode name = getNameFromFunctionDeclaration( function.getInternalNode() );

      return addViolation( name,
                           name,
                           name.getStringValue() );
   }
View Full Code Here

    * @return
    */
   protected final IFlexViolation addViolation( final IFunction function,
                                                final String messageToReplace )
   {
      final IParserNode name = getNameFromFunctionDeclaration( function.getInternalNode() );

      return addViolation( name,
                           name,
                           messageToReplace );
   }
View Full Code Here

   /**
    * @param classNode
    */
   protected void visitClass( final IParserNode classNode )
   {
      IParserNode content = null;
      for ( final IParserNode node : classNode.getChildren() )
      {
         if ( node.is( NodeKind.CONTENT ) )
         {
            content = node;
View Full Code Here

    */
   protected void visitFunction( final IParserNode functionNode,
                                 final FunctionType type )
   {
      final Iterator< IParserNode > iterator = functionNode.getChildren().iterator();
      IParserNode currentNode = iterator.next();

      while ( currentNode.is( NodeKind.META_LIST )
            || currentNode.is( NodeKind.MOD_LIST ) || currentNode.is( NodeKind.AS_DOC )
            || currentNode.is( NodeKind.MULTI_LINE_COMMENT ) )
      {
         currentNode = iterator.next();
      }
      currentNode = iterator.next();
      visitParameters( currentNode );
View Full Code Here

TOP

Related Classes of com.adobe.ac.pmd.parser.IParserNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.