Skip to content

Commit

Permalink
[core] Add parsing (but not semantics) for :instanceof('Type') adverb…
Browse files Browse the repository at this point in the history
… on .subs.

git-svn-id: https://svn.parrot.org/parrot/trunk@28099 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
jnthn committed Jun 5, 2008
1 parent 519f0ea commit 877dcaf
Show file tree
Hide file tree
Showing 6 changed files with 2,818 additions and 2,791 deletions.
1 change: 1 addition & 0 deletions compilers/imcc/imcc.l
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ SP [ ]
<emit,INITIAL>":lex" return NEED_LEX;
<emit,INITIAL>":vtable" return VTABLE_METHOD;
":unique_reg" return UNIQUE_REG;
":instanceof" return SUB_INSTANCE_OF;
".result" return RESULT;
".get_results" return GET_RESULTS;
Expand Down
13 changes: 11 additions & 2 deletions compilers/imcc/imcc.y
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ do_loadlib(PARROT_INTERP, ARGIN(const char *lib))
%token <t> PCC_BEGIN PCC_END PCC_CALL PCC_SUB PCC_BEGIN_RETURN PCC_END_RETURN
%token <t> PCC_BEGIN_YIELD PCC_END_YIELD NCI_CALL METH_CALL INVOCANT
%token <t> MAIN LOAD INIT IMMEDIATE POSTCOMP METHOD ANON OUTER NEED_LEX
%token <t> MULTI VTABLE_METHOD LOADLIB
%token <t> MULTI VTABLE_METHOD LOADLIB SUB_INSTANCE_OF
%token <t> UNIQUE_REG
%token <s> LABEL
%token <t> EMIT EOM
Expand All @@ -658,7 +658,7 @@ do_loadlib(PARROT_INTERP, ARGIN(const char *lib))
%type <t> argtype_list argtype paramtype_list paramtype
%type <t> pcc_return_many
%type <t> proto sub_proto sub_proto_list multi multi_types outer
%type <t> vtable
%type <t> vtable instanceof
%type <i> instruction assignment conditional_statement labeled_inst opt_label op_assign
%type <i> if_statement unless_statement
%type <i> func_assign get_results
Expand Down Expand Up @@ -990,6 +990,14 @@ vtable:
}
;

instanceof:
SUB_INSTANCE_OF '(' STRINGC ')'
{
$$ = 0;
IMCC_INFO(interp)->cur_unit->instance_of = $3;
}
;

multi_types:
/* empty */
{
Expand Down Expand Up @@ -1107,6 +1115,7 @@ proto:
| multi
| outer
| vtable
| instanceof
;

pcc_call:
Expand Down
Loading

0 comments on commit 877dcaf

Please sign in to comment.