Beispiel #1
0
 protected boolean DoParsing() {
   CBaseToken tok = GetCurrentToken();
   m_Token = tok.GetValue();
   GetNext();
   m_Token += ReadStringUntilEOL();
   Transcoder.logWarn(tok.getLine(), "Unparsed Token : " + m_Token);
   return true;
 }
Beispiel #2
0
 /* (non-Javadoc)
  * @see parser.CLanguageElement#ExportCustom(org.w3c.dom.Document)
  */
 protected boolean DoParsing(CFlag fCheckForNextSentence) {
   CBaseToken tok = GetCurrentToken();
   if (tok.GetType() == CTokenType.KEYWORD && tok.GetKeyword() == CCobolKeywordList.ELSE) {
     GetNext();
   }
   if (!super.DoParsing()) {
     return false;
   }
   if (fCheckForNextSentence != null) {
     fCheckForNextSentence.Set(m_fCheckForNextSentence.ISSet());
   }
   tok = GetCurrentToken();
   if (tok.GetType() == CTokenType.DOT) { // end of IF statement
     m_nEndLine = tok.getLine();
     return true;
   } else if (tok.GetKeyword() == CCobolKeywordList.END_IF) {
     m_nEndLine = tok.getLine();
     StepNext();
   }
   return true;
 }
Beispiel #3
0
 /* (non-Javadoc)
  * @see parser.CBMSElement#InterpretKeyword(lexer.CReservedKeyword, lexer.CTokenList)
  */
 protected boolean InterpretKeyword(CReservedKeyword kw, CTokenList lstTokens) {
   if (kw == CBMSKeywordList.POS) { // POS=(001,001)
     CBaseToken tok = GetCurrentToken();
     if (tok.GetType() != CTokenType.LEFT_BRACKET) {
       Transcoder.logError(getLine(), "Expecting LEFT_BRACKET");
       return false;
     }
     tok = GetNext();
     if (tok.GetType() != CTokenType.NUMBER) {
       Transcoder.logError(getLine(), "Expecting NUMBER");
       return false;
     }
     m_PosLine = tok.GetIntValue();
     tok = GetNext();
     if (tok.GetType() != CTokenType.COMMA) {
       Transcoder.logError(getLine(), "Expecting COMMA");
       return false;
     }
     tok = GetNext();
     if (tok.GetType() != CTokenType.NUMBER) {
       Transcoder.logError(getLine(), "Expecting NUMBER");
       return false;
     }
     m_PosCol = tok.GetIntValue();
     tok = GetNext();
     if (tok.GetType() != CTokenType.RIGHT_BRACKET) {
       Transcoder.logError(getLine(), "Expecting RIGHT_BRACKET");
       return false;
     }
     StepNext();
   } else if (kw == CBMSKeywordList.LENGTH) { // LENGTH=006
     CBaseToken tok = GetCurrentToken();
     if (tok.GetType() == CTokenType.NUMBER) {
       m_Length = tok.GetIntValue();
     } else {
       Transcoder.logError(getLine(), "Expecting NUMBER");
       return false;
     }
     StepNext();
   } else if (kw == CBMSKeywordList.COLOR) { // COLOR=TURQUOISE
     CBaseToken tok = GetCurrentToken();
     if (tok.GetConstant() == CBMSConstantList.TURQUOISE
         || tok.GetConstant() == CBMSConstantList.GREEN
         || tok.GetConstant() == CBMSConstantList.YELLOW
         || tok.GetConstant() == CBMSConstantList.RED
         || tok.GetConstant() == CBMSConstantList.BLUE
         || tok.GetConstant() == CBMSConstantList.PINK
         || tok.GetConstant() == CBMSConstantList.NEUTRAL
         || tok.GetConstant() == CBMSConstantList.DEFAULT) {
       m_Color = tok.GetConstant();
     } else {
       Transcoder.logError(getLine(), "Unexpecting COLOR : " + tok.GetValue());
       return false;
     }
     StepNext();
   } else if (kw == CBMSKeywordList.HILIGHT) { // HILIGHT=OFF
     CBaseToken tok = GetCurrentToken();
     if (tok.GetConstant() == CBMSConstantList.OFF
         || tok.GetConstant() == CBMSConstantList.REVERSE
         || tok.GetConstant() == CBMSConstantList.UNDERLINE) {
       m_HighLight = tok.GetConstant();
     } else {
       Transcoder.logError(getLine(), "Unexpecting HIGHLIGHT : " + tok.GetValue());
       return false;
     }
     StepNext();
   } else if (kw == CBMSKeywordList.ATTRB) { // ATTRB=(ASKIP,NORM)
     CBaseToken tok = GetCurrentToken();
     if (tok.GetType() != CTokenType.LEFT_BRACKET) {
       Transcoder.logError(getLine(), "Expecting LEFT_BRACKET");
       return false;
     }
     tok = GetNext();
     boolean bDone = false;
     while (!bDone) {
       tok = GetCurrentToken();
       if (tok.GetConstant() == CBMSConstantList.ASKIP
           || tok.GetConstant() == CBMSConstantList.DRK
           || tok.GetConstant() == CBMSConstantList.PROT
           || tok.GetConstant() == CBMSConstantList.UNPROT
           || tok.GetConstant() == CBMSConstantList.BRT
           || tok.GetConstant() == CBMSConstantList.NUM
           || tok.GetConstant() == CBMSConstantList.IC
           || tok.GetConstant() == CBMSConstantList.FSET
           || tok.GetConstant() == CBMSConstantList.NORM) {
         m_arrATTRB.addElement(tok.GetValue());
       } else if (tok.GetType() == CTokenType.RIGHT_BRACKET) {
         bDone = true;
       } else if (tok.GetType() == CTokenType.COMMA) {
       } else {
         Transcoder.logError(getLine(), "Unexpecting ATTRIBUTE : " + tok.GetValue());
         return false;
       }
       StepNext();
     }
   } else if (kw == CBMSKeywordList.JUSTIFY) { // JUSTIFY=(LEFT,BLANK)
     CBaseToken tok = GetCurrentToken();
     if (tok.GetType() != CTokenType.LEFT_BRACKET) {
       Transcoder.logError(getLine(), "Expecting LEFT_BRACKET");
       return false;
     }
     tok = GetNext();
     boolean bDone = false;
     while (!bDone) {
       tok = GetCurrentToken();
       if (tok.GetConstant() == CBMSConstantList.LEFT
           || tok.GetConstant() == CBMSConstantList.RIGHT
           || tok.GetConstant() == CBMSConstantList.ZERO
           || tok.GetConstant() == CBMSConstantList.BLANK) {
         m_arrJustify.addElement(tok.GetValue());
       } else if (tok.GetType() == CTokenType.RIGHT_BRACKET) {
         bDone = true;
       } else if (tok.GetType() == CTokenType.COMMA) {
       } else {
         Transcoder.logError(getLine(), "Unexpecting JUSTIFY : " + tok.GetValue());
         return false;
       }
       StepNext();
     }
   } else if (kw == CBMSKeywordList.INITIAL) { //
     CBaseToken tok = GetCurrentToken();
     if (tok.GetType() == CTokenType.STRING) {
       m_Value = tok.GetValue();
     } else {
       Transcoder.logError(getLine(), "Expecting STRING");
       return false;
     }
     StepNext();
   } else if (kw == CBMSKeywordList.GRPNAME) { //
     CBaseToken tok = GetCurrentToken();
     m_GrpName = tok.GetValue();
     StepNext();
   } else if (kw == CBMSKeywordList.PICIN) { //
     CBaseToken tok = GetCurrentToken();
     m_PicIn = tok.GetValue();
     StepNext();
   } else if (kw == CBMSKeywordList.PICOUT) { //
     CBaseToken tok = GetCurrentToken();
     m_PicOut = tok.GetValue();
     StepNext();
   } else {
     Transcoder.logError(getLine(), "Unexpecting keyword : " + kw.m_Name);
     return false;
   }
   return true;
 }