示例#1
0
文件: symtable.cpp 项目: DTSCode/Cx
/** enter_scope	enter a new nested scope.  Increment the nesting
 *		level.  push new scope's symbol table onto the
 *		stack.
 *
 */
void cx_symtab_stack::enter_scope(void) {

    if (++current_nesting_level > max_nesting_level) {
        cx_error(err_nesting_too_deep);
        abort_translation(abort_nesting_too_deep);
    }

    set_current_symtab(new cx_symtab);
}
示例#2
0
文件: symtable.cpp 项目: rackbone/Cx
/** enter_scope	enter a new nested scope.  Increment the nesting
 *		level.  push new scope's symbol table onto the
 *		stack.
 *
 */
void cx_symtab_stack::enter_scope(void) {

    // dont overwrite mains scope
    //if (current_nesting_level <= 1)++current_nesting_level;

    if (++current_nesting_level > max_nesting_level) {
        cx_error(err_nesting_too_deep);
        abort_translation(abort_nesting_too_deep);
    }

    set_current_symtab(new cx_symtab);
}