static void getContinuationOrWS( ss_block *ss_new, char *start ) { if( isspace( *start ) ) { getWhiteSpace( ss_new, start ); return; } /* this is technically wrong - a ' ' on an initial line is * also a label, but that would be ugly */ ss_new->type = SE_JUMPLABEL; ss_new->len = 1; }
void GetGMLBlock( ss_block *ss_new, char *start, int line ) { line = line; if( start[0] == '\0' ) { if( firstNonWS == start ) { // line is empty - // do not flag following line as having anything to do // with an unterminated " flags.inString = FALSE; } getBeyondText( ss_new ); return; } if( isGMLComment( firstChar ) ) { getGMLComment( ss_new, start, 0 ); return; } if( flags.inGMLComment ) { getGMLComment( ss_new, start, 0 ); return; } if( flags.inString ) { getString( ss_new, start, 0 ); return; } if( isspace( start[0] ) ) { getWhiteSpace( ss_new, start ); return; } switch( start[0] ) { case '"': getString( ss_new, start, 1 ); return; case ':': flags.inGMLKeyword = TRUE; break; case '.': flags.inGMLKeyword = FALSE; break; } if( isalnum( start[0] ) || ( start[0] == '_' ) ) { getText( ss_new, start ); } else { getSymbol( ss_new ); } }
void GetMkBlock( ss_block *ss_new, char *start, int line ) { line = line; if( start[0] == '\0' ) { if( firstNonWS == start ) { // line is empty - // do not flag following line as having anything to do // with an unterminated macro flags.inMacro = false; } getBeyondText( ss_new ); return; } // Preprocessor directives must start at beginning of line if( (start[0] == '!') && (firstChar == start) ) { getPreproc( ss_new, start ); return; } if( flags.inMacro ) { getMacro( ss_new, start, 0 ); return; } if( isspace( start[0] ) ) { getWhiteSpace( ss_new, start ); return; } switch( start[0] ) { case '$': getMacro( ss_new, start, 1 ); return; case '#': getComment( ss_new, start ); return; case '.': getDirective( ss_new, start ); return; } if( isalpha( start[0] ) ) { getText( ss_new, start ); } else { getSymbol( ss_new ); } }
static void getLabelOrWS( ss_block *ss_new, char *start, int text_col ) { char *text = start; while( isspace( *text ) && text_col <= 4 ) { text++; text_col++; } if( *text != '\0' && text_col <= 4 ) { ss_new->type = SE_JUMPLABEL; while( *text != '\0' && text_col <= 4 ) { if( !isdigit( *text ) && !isspace( *text ) ) { text++; ss_new->type = SE_INVALIDTEXT; break; } text++; text_col++; } ss_new->len = text - start; } else { getWhiteSpace( ss_new, start ); } }
void GetFORTRANBlock( ss_block *ss_new, char *start, int text_col ) { int length = 0; if( start[0] == '\0' ) { if( text_col == 0 ) { // line is empty - // do not flag following line as having anything to do // with an unterminated string from previous line flags.inString = false; } getBeyondText( ss_new ); return; } if( iscomment( firstChar ) ) { getComment( ss_new, start ); return; } if( text_col <= 4 ) { getLabelOrWS( ss_new, start, text_col ); return; } if( text_col == 5 ) { getContinuationOrWS( ss_new, start ); return; } if( flags.inString ) { getLiteral( ss_new, start, 0 ); return; } if( isspace( start[0] ) ) { getWhiteSpace( ss_new, start ); return; } switch( start[0] ) { case '!': getComment( ss_new, start ); return; case '\'': getLiteral( ss_new, start, 1 ); return; case '.': if( isdigit( start[1] ) ) { getFloat( ss_new, start, 1, AFTER_DOT ); return; } length = islogical( start ); if( length > 0 ) { getSymbol( ss_new, length ); return; } } if( issymbol( start[0] ) ) { getSymbol( ss_new, 1 ); return; } if( isdigit( *start ) ) { getNumber( ss_new, start ); return; } if( isalpha( *start ) || (*start == '_') || (*start == '$') ) { getText( ss_new, start ); return; } getInvalidChar( ss_new ); }
void GetRexxBlock( ss_block *ss_new, char *start, line *line, linenum line_no ) { line = line; line_no = line_no; if( start[0] == '\0' ) { if( firstNonWS == start ) { // line is empty - // do not flag following line as having anything to do // with an unterminated " or # or // from previous line flags.inString = flags.inPreprocessor = flags.inCPPComment = false; } getBeyondText( ss_new ); return; } if( flags.inCComment ) { getCComment( ss_new, start, 0 ); return; } if( flags.inCPPComment ) { getCPPComment( ss_new, start ); return; } if( flags.inPreprocessor ) { getPreprocessor( ss_new, start ); return; } if( flags.inString ) { getString( ss_new, start, 0 ); return; } if( isspace( start[0] ) ) { getWhiteSpace( ss_new, start ); return; } if( *firstNonWS == '#' && (!EditFlags.PPKeywordOnly || firstNonWS == start) ) { getPreprocessor( ss_new, start ); return; } switch( start[0] ) { case '"': getString( ss_new, start, 1 ); return; case '/': if( start[1] == '*' ) { getCComment( ss_new, start, 2 ); return; } else if( start[1] == '/' ) { getCPPComment( ss_new, start ); return; } break; case '\'': getChar( ss_new, start, 1 ); return; case 'L': if( start[1] == '\'' ) { // wide char constant getChar( ss_new, start, 2 ); return; } break; case '.': if( isdigit( start[1] ) ) { getFloat( ss_new, start, 1, AFTER_DOT ); return; } break; case '0': if( start[1] == 'x' || start[1] == 'X' ) { getHex( ss_new, start ); return; } else { getNumber( ss_new, start, '7' ); return; } break; } if( issymbol( start[0] ) ) { getSymbol( ss_new ); return; } if( isdigit( start[0] ) ) { getNumber( ss_new, start, '9' ); return; } if( isalpha( *start ) || ( *start == '_' ) ) { getText( ss_new, start ); return; } getInvalidChar( ss_new ); }
void GetPerlBlock( ss_block *ss_new, char *start, line *line, linenum line_no ) { line = line; line_no = line_no; if( start[0] == '\0' ) { if( firstNonWS == start ) { // line is empty - // do not flag following line as having anything to do // with an unterminated " or # or // from previous line flags.inString = false; } getBeyondText( ss_new ); return; } if( flags.inString ) { getString( ss_new, start, 0 ); return; } if( isspace( start[0] ) ) { getWhiteSpace( ss_new, start ); return; } switch( start[0] ) { case '#': getPerlComment( ss_new, start ); return; case '"': getString( ss_new, start, 1 ); return; case '/': if( flags.beforeRegExp ) { getRegExp( ss_new, start ); return; } break; case '$': case '@': case '%': if( isalpha( start[1] ) || (start[0] == '$' && start[1] == '#') ) { getVariable( ss_new, start ); return; } else if( start[0] == '$' && (isdigit( start[1] ) || isspecvar( start[1] )) ) { getSpecialVariable( ss_new, start ); return; } break; case '\'': getChar( ss_new, start, 1 ); return; case '.': if( isdigit( start[1] ) ) { getFloat( ss_new, start, 1, AFTER_DOT ); return; } break; case '0': if( start[1] == 'x' || start[1] == 'X' ) { getHex( ss_new, start ); return; } else { getNumber( ss_new, start, '7' ); return; } break; } if( issymbol( start[0] ) ) { getSymbol( ss_new, start ); return; } if( isdigit( start[0] ) ) { getNumber( ss_new, start, '9' ); return; } if( isalpha( *start ) || (*start == '_') ) { getText( ss_new, start ); return; } getInvalidChar( ss_new ); }