--- parser3/src/main/compile_tools.C 2002/01/31 16:39:01 1.42 +++ parser3/src/main/compile_tools.C 2002/03/27 15:30:35 1.46 @@ -1,10 +1,10 @@ /** @file Parser: compiler support helper functions. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) + Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) - $Id: compile_tools.C,v 1.42 2002/01/31 16:39:01 paf Exp $ + $Id: compile_tools.C,v 1.46 2002/03/27 15:30:35 paf Exp $ */ #include "compile_tools.h" @@ -73,10 +73,9 @@ Array *VL(Value *value) { Value *LA2V(Array *literal_string_array, int offset) { Operation op; op.cast=literal_string_array->get(offset+0); - if(op.code!=OP_VALUE) - return 0; - - return static_cast(literal_string_array->get(offset+1)); + return op.code==OP_VALUE? + static_cast(literal_string_array->get(offset+1)) + :0; } void change_string_literal_to_double_literal(Array *literal_string_array) { @@ -94,23 +93,11 @@ void push_LS(parse_control& pc, lexical_ pc.ls_stack[pc.ls_sp++]=pc.ls; pc.ls=new_state; } else - throw Exception(0, 0, 0, "push_LS: ls_stack overflow"); + throw Exception(0, 0, "push_LS: ls_stack overflow"); } void pop_LS(parse_control& pc) { if(--pc.ls_sp>=0) pc.ls=pc.ls_stack[pc.ls_sp]; else - throw Exception(0, 0, 0, "pop_LS: ls_stack underflow"); -} - -void push_OCA(parse_control& pc, bool operator_call_allowed) { - if(pc.oca_sp