comparison src/lex.ll @ 13249:7861a5fd3479

accept enumeration keyword * octave.gperf (octave_kw_id): New keyword ids, enumeration_kw and endenumeration_kw. (octave_kw): Add enumeration and endenumeration to the struct. * lex.ll (is_keyword_token): Handle enumeration and endenumeration. * oct-parse.yy (ENUMERATION): New token. (enum_beg, enum_block, enum_list, class_enum): New non-terminals. (class_body): Accept enum_block. * token.h (token::enumeration_end): New end_tok_type enum value.
author John W. Eaton <jwe@octave.org>
date Thu, 29 Sep 2011 14:11:39 -0400
parents 0c69a564f2be
children 28e3e9158d70
comparison
equal deleted inserted replaced
13247:e36c2f4ea8f5 13249:7861a5fd3479
1539 case endclassdef_kw: 1539 case endclassdef_kw:
1540 yylval.tok_val = new token (token::classdef_end, l, c); 1540 yylval.tok_val = new token (token::classdef_end, l, c);
1541 lexer_flags.at_beginning_of_statement = true; 1541 lexer_flags.at_beginning_of_statement = true;
1542 break; 1542 break;
1543 1543
1544 case endenumeration_kw:
1545 yylval.tok_val = new token (token::enumeration_end, l, c);
1546 lexer_flags.at_beginning_of_statement = true;
1547 break;
1548
1544 case endevents_kw: 1549 case endevents_kw:
1545 yylval.tok_val = new token (token::events_end, l, c); 1550 yylval.tok_val = new token (token::events_end, l, c);
1546 lexer_flags.at_beginning_of_statement = true; 1551 lexer_flags.at_beginning_of_statement = true;
1547 break; 1552 break;
1548 1553
1587 // declarations. 1592 // declarations.
1588 if (! lexer_flags.maybe_classdef_get_set_method) 1593 if (! lexer_flags.maybe_classdef_get_set_method)
1589 return 0; 1594 return 0;
1590 break; 1595 break;
1591 1596
1597 case enumeration_kw:
1598 case events_kw:
1599 case methods_kw:
1592 case properties_kw: 1600 case properties_kw:
1593 case methods_kw:
1594 case events_kw:
1595 // 'properties', 'methods' and 'events' are keywords for 1601 // 'properties', 'methods' and 'events' are keywords for
1596 // classdef blocks. 1602 // classdef blocks.
1597 if (! lexer_flags.parsing_classdef) 1603 if (! lexer_flags.parsing_classdef)
1598 return 0; 1604 return 0;
1599 // fall through ... 1605 // fall through ...