Examples of CRLineAnalyzer


Examples of com.uic.ase.proj.xbn.config.CRLineAnalyzer

  public VWObject getVWObject(ForLineRetrieval for_lineRetrieval, CRConfig cr_config, Outputter optr_dbg, VWObject acoSbsbc_cfgVars, CRFilter cr_filter) throws ConfigFormatException  {
    crlao = new CRLAObjects(cr_config);

    initVarState();

    CRLineAnalyzer crla = null;
    try  {
      while(for_lineRetrieval.hasMoreLines())  {
        StringBuffer sbLine = for_lineRetrieval.getNextLine();
        iLine = for_lineRetrieval.getLineNumberPrev();
        crla = new CRLineAnalyzer(sbLine, iLine, iMLCStartLine, iVarStartLine, ssbVarName, cVarDelim, optr_dbg, crlao);

        boolean bEOF = !for_lineRetrieval.hasMoreLines();

        if((crla.isStartLine()  ||  bEOF&&
             ssbVarName != null)  {
          //This is (the start of a new comment/variable OR
          //the end of the source) AND there is a variable
          //that has not yet been processed.

          if(bEOF  &&  crla.hasValue()  &&  !crla.isStartLine())  {
            //This is the very last line in the source text  AND
            //There is a value in this line  AND
            //it is *not* the first line in a variable.
            ssbValue.append(crla.getValue());
          }

          addVariable(iVarStartLine, ssbVarName, cVarDelim, ssbValue, null, optr_dbg, cr_filter, bEOF, crlao, acoSbsbc_cfgVars);
          initVarState();
        }
        boolean bSLValue = false;
        if(crla.hasName())  {
          //SANITY CHECK...start
          //  if(!crla.hasValue())  {
          //    throwAX("SANITY CHECK FAILURE:  crla has a name '" + crla.getName() + "', but not a value for it.  Bad programmer.  Bad *bad* programmer.");
          //  }
          //SANITY CHECK...end

          ssbVarName = new SOBStringBuffer(crla.getName());
          cVarDelim = crla.getDelimiter();
          iVarStartLine = iLine;
          if(crla.getValue() == null)  {
            bSLValue = true;
          else if(cr_config.getCRCVariable().is1stLineWSEmptyString()  &&
                     crlao.uStr.hasLegalChars(crla.getValue(), UtilChar.getAOCInvisible()))  {
            bSLValue = true;
          }

          if(bSLValue)  {
            //This is a single-line value.  Process it.
            String sValue = ((crla.getValue() != null""  null);
            addVariable(iVarStartLine, ssbVarName, cVarDelim, null, sValue, optr_dbg, cr_filter, false, crlao, acoSbsbc_cfgVars);
            initVarState();
            continue;
          }

        }

        if(!bSLValue  &&  crla.hasValue())  {
          //This is the second or subseqent line in a
          //*multi*-line value (at least, it's multi-line
          //before trimming, which potentially happens
          //below).
          if(ssbValue == null)  {
            ssbValue = new SOBStringBuffer(crla.getValue());
          else  {
            ssbValue.append(crla.getValue());
          }
        }

        if(iMLCStartLine != crla.getMLCStartLine())  {
          iMLCStartLine = crla.getMLCStartLine();
        }
      }
    }  catch(NullPointerException npx)  {
      throwAXIfNull(for_lineRetrieval, "for_lineRetrieval", sCNSTR);
      throwAXIfNull(optr_dbg, "optr_dbg", sCNSTR);
      throwAX("constructor:  UNKNOWN NPX:  " + npx.toString());
    }

    if(ssbVarName != null)  {
      //The very last line in the source is part of variable
      //that is *not* single line.
      cVarDelim = crla.getDelimiter();
      addVariable(iVarStartLine, ssbVarName, cVarDelim, ssbValue, null, optr_dbg, cr_filter, true, crlao, acoSbsbc_cfgVars);
    }

    return acoSbsbc_cfgVars;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.