Package flex2.compiler

Examples of flex2.compiler.Logger


     */
    public void analyze4(CompilationUnit unit, SymbolTable symbolTable)
    {
    CompilationUnit interfaceUnit = (CompilationUnit) unit.getContext().getAttribute(MxmlCompiler.DELEGATE_UNIT);

    Logger original = setLogAdapter(unit);
        asc.analyze4(interfaceUnit, symbolTable);
        ThreadLocalToolkit.setLogger(original);

        for( Map.Entry<String, AbcClass> entry : interfaceUnit.classTable.entrySet() )
        {
View Full Code Here


   */
  private CompilationUnit compileInterface(Source newSource, Source origSource, DocumentInfo info,
                       LineNumberMap map, SymbolTable symbolTable)
  {
    // set the current logger to the one with line number mapping support
    Logger original = ThreadLocalToolkit.getLogger();

    if (mxmlConfiguration.getGenerateAbstractSyntaxTree())
    {
      Logger adapter = new AbstractSyntaxTreeLogAdapter(original);
      ThreadLocalToolkit.setLogger(adapter);
    }
    else
    {
    MxmlLogAdapter adapter = new MxmlLogAdapter(original, map);
    adapter.addLineNumberMaps(origSource.getSourceFragmentLineMaps());
    ThreadLocalToolkit.setLogger(adapter);
    }

    CompilationUnit interfaceUnit = asc.parse1(newSource, symbolTable);
View Full Code Here

    // from above, but we turn anround and pass it to our embedded compiler as the "main" helper.
  }

    private Logger setLogAdapter(CompilationUnit unit)
    {
        Logger original = ThreadLocalToolkit.getLogger();

    if (mxmlConfiguration.getGenerateAbstractSyntaxTree())
    {
      Logger adapter = new AbstractSyntaxTreeLogAdapter(original);
      ThreadLocalToolkit.setLogger(adapter);
    }
    else
    {
      LineNumberMap map = (LineNumberMap) unit.getContext().getAttribute(MxmlCompiler.LINE_NUMBER_MAP);
      MxmlLogAdapter adapter = new MxmlLogAdapter(original, map);
      adapter.addLineNumberMaps(unit.getSource().getSourceFragmentLineMaps());
      ThreadLocalToolkit.setLogger(adapter);
    }

        return original;
    }
View Full Code Here

     * Initializes a Flex specific logger to bridge FXG messages back to the
     * Flex compiler's logging system.
     */
    private void setupLogger()
    {
        Logger logger = ThreadLocalToolkit.getLogger();
        if (logger != null)
        {
            FXGLogger fxgLogger = FXGLog.getLogger();
            if (!(fxgLogger instanceof FlexLoggerAdapter))
            {
View Full Code Here

        super(level);
    }

    public void log(int level, Object message, Throwable t, String location, int line, int column, Object... arguments)
    {
        Logger delegateLogger = ThreadLocalToolkit.getLogger();
        if (delegateLogger != null)
        {
            String messageString = null;
            if (message != null)
                messageString = getLocalizedMessage(message.toString(), arguments);

            if (level == FXGLogger.ERROR)
            {
                delegateLogger.logError(location, line, column, messageString);
            }
            else if (level == FXGLogger.WARN)
            {
                delegateLogger.logWarning(location, line, column, messageString);
            }
            else if (level == FXGLogger.INFO)
            {
                delegateLogger.logInfo(location, line, column, messageString);
            }
            else if (level == FXGLogger.DEBUG)
            {
                delegateLogger.logDebug(location, line, column, messageString);
            }
        }
    }
View Full Code Here

        Parser parser = new Parser(context, offsetInputBuffer, origin, emitDocInfo);
        parser.block_kind_stack.add(Tokens.PACKAGE_TOKEN);
        parser.block_kind_stack.add(Tokens.CLASS_TOKEN);
        parser.config_namespaces.push_back(configNamespaces);

        Logger original = ThreadLocalToolkit.getLogger();

        CodeFragmentLogAdapter codeFragmentLogAdapter =
            new CodeFragmentLogAdapter(original, lineNumberOffset);
        ThreadLocalToolkit.setLogger(codeFragmentLogAdapter);
View Full Code Here

    //  - superclass, interface and metadata declarations, as specified in the MXML
    //  - public var declarations for id-attributed children of the MXML
    //  - user-supplied script code
    LineNumberMap map = new LineNumberMap(source.getName());
    Source newSource;
    Logger original = ThreadLocalToolkit.getLogger();

    if (mxmlConfiguration.getGenerateAbstractSyntaxTree())
    {
      Logger adapter = new AbstractSyntaxTreeLogAdapter(original);
      ThreadLocalToolkit.setLogger(adapter);
      newSource = generateSkeletonAST(docInfo, analyzer.bogusImports, source, symbolTable);
    }
    else
    {
      MxmlLogAdapter adapter = new MxmlLogAdapter(original, map);
      adapter.addLineNumberMaps(unit.getSource().getSourceFragmentLineMaps());
      ThreadLocalToolkit.setLogger(adapter);
      newSource = generateSkeleton(docInfo, analyzer.bogusImports, map, source);

      if (newSource == null)
      {
View Full Code Here

     */
    public void analyze1(CompilationUnit unit, SymbolTable symbolTable)
    {
    CompilationUnit interfaceUnit = (CompilationUnit) unit.getContext().getAttribute(MxmlCompiler.DELEGATE_UNIT);

    Logger original = setLogAdapter(unit);
        asc.analyze1(interfaceUnit, symbolTable);
        ThreadLocalToolkit.setLogger(original);

        Source.transferTypeInfo(interfaceUnit, unit);
        Source.transferNamespaces(interfaceUnit, unit);
View Full Code Here

    public void analyze2(CompilationUnit unit, SymbolTable symbolTable)
    {
    CompilationUnit interfaceUnit = (CompilationUnit) unit.getContext().getAttribute(MxmlCompiler.DELEGATE_UNIT);
        Source.transferDependencies(unit, interfaceUnit);
       
    Logger original = setLogAdapter(unit);
        asc.analyze2(interfaceUnit, symbolTable);
        ThreadLocalToolkit.setLogger(original);

        Source.transferDependencies(interfaceUnit, unit);
    }
View Full Code Here

        // C: But we tell asc that those bogus statements are legitimate.
        //    Don't try this in ImplementationCompiler!
        interfaceUnit.importDefinitionStatements.addAll(importDefinitionStatements);

    Logger original = setLogAdapter(unit);
        asc.analyze3(interfaceUnit, symbolTable);
        ThreadLocalToolkit.setLogger(original);
    }
View Full Code Here

TOP

Related Classes of flex2.compiler.Logger

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.