This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Add internal function to abort parsing
[perl5.git] / regen / opcodes
CommitLineData
f8a58b02
NC
1# New ops always go at the end
2# The restriction on having custom as the last op has been removed
3
4# A recapitulation of the format of this file:
5# The file consists of five columns: the name of the op, an English
6# description, the name of the "check" routine used to optimize this
7# operation, some flags, and a description of the operands.
8
9# The flags consist of options followed by a mandatory op class signifier
10
11# The classes are:
12# baseop - 0 unop - 1 binop - 2
13# logop - | listop - @ pmop - /
14# padop/svop - $ padop - # (unused) loop - {
15# baseop/unop - % loopexop - } filestatop - -
b46e009d 16# pvop/svop - " cop - ; methop - .
2f7c6295 17# unop_aux - +
f8a58b02
NC
18
19# Other options are:
738ec380
DM
20# needs stack mark - m (OA_MARK)
21# needs constant folding - f (OA_FOLDCONST)
22# produces a scalar - s (OA_RETSCALAR)
23# produces an integer - i (unused)
24# needs a target - t (OA_TARGET)
25# target can be in a pad - T (OA_TARGET|OA_TARGLEX)
26# has a corresponding integer version - I (OA_OTHERINT)
e791f90a 27# make temp copy in list assignment - d (OA_DANGEROUS)
738ec380 28# uses $_ if no argument given - u (OA_DEFGV)
f8a58b02
NC
29
30# Values for the operands are:
31# scalar - S list - L array - A
32# hash - H sub (CV) - C file - F
33# socket - Fs filetest - F- filetest_access - F-+
a9f19d0f 34# num-compare - S< dirhandle - DF infix bitwise - S|
f8a58b02
NC
35
36# reference - R
37# "?" denotes an optional operand.
38
39# Nothing.
40
41null null operation ck_null 0
42stub stub ck_null 0
43scalar scalar ck_fun s% S
44
45# Pushy stuff.
46
47pushmark pushmark ck_null s0
48wantarray wantarray ck_null is0
49
50const constant item ck_svconst s$
51
52gvsv scalar variable ck_null ds$
53gv glob value ck_null ds$
6e372f32 54gelem glob elem ck_null ds2 S S
f8a58b02
NC
55padsv private variable ck_null ds0
56padav private array ck_null d0
57padhv private hash ck_null d0
58padany private value ck_null d0
59
f8a58b02
NC
60# References and stuff.
61
62rv2gv ref-to-glob cast ck_rvconst ds1
63rv2sv scalar dereference ck_rvconst ds1
64av2arylen array length ck_null is1
65rv2cv subroutine dereference ck_rvconst d1
01762542 66anoncode anonymous subroutine ck_anoncode s$
eb4ec35b 67prototype subroutine prototype ck_prototype su% S?
f8a58b02
NC
68refgen reference constructor ck_spair m1 L
69srefgen single ref constructor ck_null fs1 S
70ref reference-type operator ck_fun stu% S?
71bless bless ck_fun s@ S S?
72
73# Pushy I/O.
74
9ce1fb7d 75backtick quoted execution (``, qx) ck_backtick tu% S?
f8a58b02
NC
76# glob defaults its first arg to $_
77glob glob ck_glob t@ S?
78readline <HANDLE> ck_readline t% F?
79rcatline append I/O operator ck_null t$
80
81# Bindable operators.
82
83regcmaybe regexp internal guard ck_fun s1 S
84regcreset regexp internal reset ck_fun s1 S
85regcomp regexp compilation ck_null s| S
9d99d451 86match pattern match (m//) ck_match /
f8a58b02 87qr pattern quote (qr//) ck_match s/
7f581e76
FC
88subst substitution (s///) ck_match is/ S
89substcont substitution iterator ck_null is|
f8a58b02 90trans transliteration (tr///) ck_match is" S
bfa14884
NC
91# y///r
92transr transliteration (tr///) ck_match is" S
f8a58b02
NC
93
94# Lvalue operators.
f8a58b02 95
1257c081 96sassign scalar assignment ck_sassign s2 S S
f8a58b02
NC
97aassign list assignment ck_null t2 L L
98
99chop chop ck_spair mts% L
100schop scalar chop ck_null stu% S?
101chomp chomp ck_spair mTs% L
102schomp scalar chomp ck_null sTu% S?
103defined defined operator ck_defined isu% S?
89c5c07e 104undef undef operator ck_fun s% R?
f8a58b02 105study study ck_fun su% S?
abe56f58 106pos match position ck_fun stu% R?
f8a58b02
NC
107
108preinc preincrement (++) ck_lfun dIs1 S
109i_preinc integer preincrement (++) ck_lfun dis1 S
110predec predecrement (--) ck_lfun dIs1 S
111i_predec integer predecrement (--) ck_lfun dis1 S
3baa0581
FC
112postinc postincrement (++) ck_lfun Ist1 S
113i_postinc integer postincrement (++) ck_lfun ist1 S
114postdec postdecrement (--) ck_lfun Ist1 S
115i_postdec integer postdecrement (--) ck_lfun ist1 S
f8a58b02
NC
116
117# Ordinary operators.
118
119pow exponentiation (**) ck_null fsT2 S S
120
121multiply multiplication (*) ck_null IfsT2 S S
122i_multiply integer multiplication (*) ck_null ifsT2 S S
123divide division (/) ck_null IfsT2 S S
124i_divide integer division (/) ck_null ifsT2 S S
125modulo modulus (%) ck_null IifsT2 S S
126i_modulo integer modulus (%) ck_null ifsT2 S S
21639bf4 127repeat repeat (x) ck_repeat fmt2 L S
f8a58b02
NC
128
129add addition (+) ck_null IfsT2 S S
130i_add integer addition (+) ck_null ifsT2 S S
131subtract subtraction (-) ck_null IfsT2 S S
132i_subtract integer subtraction (-) ck_null ifsT2 S S
133concat concatenation (.) or string ck_concat fsT2 S S
73f4c4fe 134stringify string ck_stringify fsT@ S
f8a58b02
NC
135
136left_shift left bitshift (<<) ck_bitop fsT2 S S
137right_shift right bitshift (>>) ck_bitop fsT2 S S
138
89474f50
FC
139lt numeric lt (<) ck_cmp Iifs2 S S<
140i_lt integer lt (<) ck_cmp ifs2 S S<
141gt numeric gt (>) ck_cmp Iifs2 S S<
142i_gt integer gt (>) ck_cmp ifs2 S S<
143le numeric le (<=) ck_cmp Iifs2 S S<
144i_le integer le (<=) ck_cmp ifs2 S S<
145ge numeric ge (>=) ck_cmp Iifs2 S S<
146i_ge integer ge (>=) ck_cmp ifs2 S S<
2b420b63
JC
147eq numeric eq (==) ck_null Iifs2 S S<
148i_eq integer eq (==) ck_null ifs2 S S<
149ne numeric ne (!=) ck_null Iifs2 S S<
150i_ne integer ne (!=) ck_null ifs2 S S<
151ncmp numeric comparison (<=>) ck_null Iifst2 S S<
21639bf4 152i_ncmp integer comparison (<=>) ck_null ifst2 S S<
f8a58b02
NC
153
154slt string lt ck_null ifs2 S S
155sgt string gt ck_null ifs2 S S
156sle string le ck_null ifs2 S S
157sge string ge ck_null ifs2 S S
158seq string eq ck_null ifs2 S S
159sne string ne ck_null ifs2 S S
21639bf4 160scmp string comparison (cmp) ck_null ifst2 S S
f8a58b02 161
a9f19d0f
FC
162bit_and bitwise and (&) ck_bitop fst2 S S|
163bit_xor bitwise xor (^) ck_bitop fst2 S S|
164bit_or bitwise or (|) ck_bitop fst2 S S|
5cb51e4d 165nbit_and numeric bitwise and (&) ck_bitop fsT2 S S|
a9f19d0f
FC
166nbit_xor numeric bitwise xor (^) ck_bitop fsT2 S S|
167nbit_or numeric bitwise or (|) ck_bitop fsT2 S S|
118a40c4
FC
168sbit_and string bitwise and (&.) ck_bitop fst2 S S|
169sbit_xor string bitwise xor (^.) ck_bitop fst2 S S|
170sbit_or string bitwise or (|.) ck_bitop fst2 S S|
f8a58b02
NC
171
172negate negation (-) ck_null Ifst1 S
a9dec3fe 173i_negate integer negation (-) ck_null ifst1 S
f8a58b02 174not not ck_null ifs1 S
21639bf4 175complement 1's complement (~) ck_bitop fst1 S
5d01050a 176ncomplement numeric 1's complement (~) ck_bitop fsT1 S
a6eb74ec
FC
177# scomplement uses ck_bitop only for the experimental warning. Once the
178# warning is gone, this can change to ck_null.
179scomplement string 1's complement (~) ck_bitop fsT1 S
f8a58b02
NC
180
181smartmatch smart match ck_smartmatch s2
182
183# High falutin' math.
184
185atan2 atan2 ck_fun fsT@ S S
186sin sin ck_fun fsTu% S?
187cos cos ck_fun fsTu% S?
188rand rand ck_fun sT% S?
189srand srand ck_fun sT% S?
190exp exp ck_fun fsTu% S?
191log log ck_fun fsTu% S?
192sqrt sqrt ck_fun fsTu% S?
193
194# Lowbrow math.
195
196int int ck_fun fsTu% S?
197hex hex ck_fun fsTu% S?
198oct oct ck_fun fsTu% S?
199abs abs ck_fun fsTu% S?
200
201# String stuff.
202
e508c8a4 203length length ck_length ifsTu% S?
f8a58b02 204substr substr ck_substr st@ S S S? S?
21639bf4 205vec vec ck_fun ist@ S S S
f8a58b02
NC
206
207index index ck_index isT@ S S S?
208rindex rindex ck_index isT@ S S S?
209
69974ce6 210sprintf sprintf ck_lfun fmst@ S L
f8a58b02
NC
211formline formline ck_fun ms@ S L
212ord ord ck_fun ifsTu% S?
213chr chr ck_fun fsTu% S?
214crypt crypt ck_fun fsT@ S S
215ucfirst ucfirst ck_fun fstu% S?
216lcfirst lcfirst ck_fun fstu% S?
217uc uc ck_fun fstu% S?
218lc lc ck_fun fstu% S?
219quotemeta quotemeta ck_fun fstu% S?
220
221# Arrays.
222
223rv2av array dereference ck_rvconst dt1
689d8423 224aelemfast constant array element ck_null ds$ A S
bfa14884 225aelemfast_lex constant lexical array element ck_null d0 A S
f8a58b02
NC
226aelem array element ck_null s2 A S
227aslice array slice ck_null m@ A L
6dd3e0f2 228kvaslice index/value array slice ck_null m@ A L
f8a58b02 229
d86b3122 230aeach each on array ck_each d% A
d86b3122 231avalues values on array ck_each dt% A
d88ca568 232akeys keys on array ck_each t% A
f8a58b02
NC
233
234# Hashes.
235
d86b3122
FC
236each each ck_each d% H
237values values ck_each dt% H
f8a58b02
NC
238keys keys ck_each t% H
239delete delete ck_delete % S
240exists exists ck_exists is% S
1a8bdda9 241rv2hv hash dereference ck_rvconst d1
f8a58b02
NC
242helem hash element ck_null s2 H S
243hslice hash slice ck_null m@ H L
5cae3edb 244kvhslice key/value hash slice ck_null m@ H L
f8a58b02 245
fedf30e1
DM
246# mixed array and hash access
247
248multideref array or hash lookup ck_null ds+
249
f8a58b02
NC
250# Explosives and implosives.
251
ea5703f4 252unpack unpack ck_fun u@ S S?
dd9a6ccf 253pack pack ck_fun fmst@ S L
5012eebe 254split split ck_split t/ S S S
987c9691 255join join or string ck_join fmst@ S L
f8a58b02
NC
256
257# List operators.
258
259list list ck_null m@ L
260lslice list slice ck_null 2 H L L
26321c2d 261anonlist anonymous array ([]) ck_fun ms@ L
f8a58b02
NC
262anonhash anonymous hash ({}) ck_fun ms@ L
263
d4fc4415
FC
264splice splice ck_fun m@ A S? S? L
265push push ck_fun imsT@ A L
f8a58b02
NC
266pop pop ck_shift s% A?
267shift shift ck_shift s% A?
d4fc4415 268unshift unshift ck_fun imsT@ A L
61aeaf96 269sort sort ck_sort m@ C? L
f8a58b02
NC
270reverse reverse ck_fun mt@ L
271
f39944c1
FC
272grepstart grep ck_grep m@ C L
273grepwhile grep iterator ck_null t|
f8a58b02 274
f39944c1
FC
275mapstart map ck_grep m@ C L
276mapwhile map iterator ck_null t|
f8a58b02
NC
277
278# Range stuff.
279
280range flipflop ck_null | S S
281flip range (or flip) ck_null 1 S S
282flop range (or flop) ck_null 1
283
284# Control.
285
286and logical and (&&) ck_null |
287or logical or (||) ck_null |
288xor logical xor ck_null fs2 S S
289dor defined or (//) ck_null |
aafd37e7 290cond_expr conditional expression ck_null |
f8a58b02
NC
291andassign logical and assignment (&&=) ck_null s|
292orassign logical or assignment (||=) ck_null s|
293dorassign defined or assignment (//=) ck_null s|
294
b46e009d 295method method lookup ck_method d.
57ee255e 296entersub subroutine entry ck_subr dm1 L
f8a58b02
NC
297leavesub subroutine exit ck_null 1
298leavesublv lvalue subroutine return ck_null 1
4fa06845
DM
299argcheck check subroutine arguments ck_null +
300argelem subroutine argument ck_null +
301argdefelem subroutine argument default value ck_null |
f8a58b02
NC
302caller caller ck_fun t% S?
303warn warn ck_fun imst@ L
2eb51413 304die die ck_fun imst@ L
f8a58b02
NC
305reset symbol reset ck_fun is% S?
306
307lineseq line sequence ck_null @
308nextstate next statement ck_null s;
309dbstate debug next statement ck_null s;
310unstack iteration finalizer ck_null s0
311enter block entry ck_null 0
312leave block exit ck_null @
313scope block ck_null @
314enteriter foreach loop entry ck_null d{
315iter foreach loop iterator ck_null 0
316enterloop loop entry ck_null d{
317leaveloop loop exit ck_null 2
b31e13ff
FC
318return return ck_return m@ L
319last last ck_null s}
320next next ck_null s}
321redo redo ck_null s}
f8a58b02 322dump dump ck_null ds}
b31e13ff 323goto goto ck_null s}
26812b4a 324exit exit ck_fun s% S?
b46e009d 325method_named method with known name ck_null d.
7d6c333c 326method_super super with known name ck_null d.
810bd8b7 327method_redir redirect method with known name ck_null d.
328method_redir_super redirect super method with known name ck_null d.
f8a58b02
NC
329
330entergiven given() ck_null d|
331leavegiven leave given block ck_null 1
332enterwhen when() ck_null d|
333leavewhen leave when block ck_null 1
334break break ck_null 0
335continue continue ck_null 0
336
337# I/O.
338
339open open ck_open ismt@ F S? L
340close close ck_fun is% F?
341pipe_op pipe ck_fun is@ F F
342
343fileno fileno ck_fun ist% F
344umask umask ck_fun ist% S?
345binmode binmode ck_fun s@ F S?
346
347tie tie ck_fun idms@ R S L
348untie untie ck_fun is% R
6575cde0 349tied tied ck_fun ds% R
f8a58b02
NC
350dbmopen dbmopen ck_fun is@ H S S
351dbmclose dbmclose ck_fun is% H
352
353sselect select system call ck_select t@ S S S S
354select select ck_select st@ F?
355
356getc getc ck_eof st% F?
357read read ck_fun imst@ F R S S?
fc5ae97d 358enterwrite write ck_fun is% F?
f8a58b02
NC
359leavewrite write exit ck_null 1
360
361prtf printf ck_listiob ims@ F? L
362print print ck_listiob ims@ F? L
363say say ck_listiob ims@ F? L
364
365sysopen sysopen ck_fun s@ F S S S?
366sysseek sysseek ck_fun s@ F S S
367sysread sysread ck_fun imst@ F R S S?
368syswrite syswrite ck_fun imst@ F S S? S?
369
370eof eof ck_eof is% F?
8dc99089 371tell tell ck_tell st% F?
423e8af5 372seek seek ck_tell s@ F S S
f8a58b02
NC
373# truncate really behaves as if it had both "S S" and "F S"
374truncate truncate ck_trunc is@ S S
375
376fcntl fcntl ck_fun st@ F S S
377ioctl ioctl ck_fun st@ F S S
378flock flock ck_fun isT@ F S
379
380# Sockets. OP_IS_SOCKET wants them consecutive (so moved 1st 2)
381
382send send ck_fun imst@ Fs S S S?
383recv recv ck_fun imst@ Fs R S S
384
385socket socket ck_fun is@ Fs S S S
386sockpair socketpair ck_fun is@ Fs Fs S S S
387
388bind bind ck_fun is@ Fs S
389connect connect ck_fun is@ Fs S
390listen listen ck_fun is@ Fs S
391accept accept ck_fun ist@ Fs Fs
392shutdown shutdown ck_fun ist@ Fs S
393
394gsockopt getsockopt ck_fun is@ Fs S S
395ssockopt setsockopt ck_fun is@ Fs S S S
396
397getsockname getsockname ck_fun is% Fs
398getpeername getpeername ck_fun is% Fs
399
400# Stat calls. OP_IS_FILETEST wants them consecutive.
401
465bc0f5
FC
402lstat lstat ck_ftst u- F?
403stat stat ck_ftst u- F?
f8a58b02
NC
404ftrread -R ck_ftst isu- F-+
405ftrwrite -W ck_ftst isu- F-+
406ftrexec -X ck_ftst isu- F-+
407fteread -r ck_ftst isu- F-+
408ftewrite -w ck_ftst isu- F-+
409fteexec -x ck_ftst isu- F-+
410ftis -e ck_ftst isu- F-
411ftsize -s ck_ftst istu- F-
412ftmtime -M ck_ftst stu- F-
413ftatime -A ck_ftst stu- F-
414ftctime -C ck_ftst stu- F-
415ftrowned -O ck_ftst isu- F-
416fteowned -o ck_ftst isu- F-
417ftzero -z ck_ftst isu- F-
418ftsock -S ck_ftst isu- F-
419ftchr -c ck_ftst isu- F-
420ftblk -b ck_ftst isu- F-
421ftfile -f ck_ftst isu- F-
422ftdir -d ck_ftst isu- F-
423ftpipe -p ck_ftst isu- F-
424ftsuid -u ck_ftst isu- F-
425ftsgid -g ck_ftst isu- F-
426ftsvtx -k ck_ftst isu- F-
427ftlink -l ck_ftst isu- F-
428fttty -t ck_ftst is- F-
429fttext -T ck_ftst isu- F-
430ftbinary -B ck_ftst isu- F-
431
432# File calls.
433
434# chdir really behaves as if it had both "S?" and "F?"
8777c9be 435chdir chdir ck_trunc isT% S?
f8a58b02
NC
436chown chown ck_fun imsT@ L
437chroot chroot ck_fun isTu% S?
438unlink unlink ck_fun imsTu@ L
439chmod chmod ck_fun imsT@ L
440utime utime ck_fun imsT@ L
441rename rename ck_fun isT@ S S
442link link ck_fun isT@ S S
443symlink symlink ck_fun isT@ S S
444readlink readlink ck_fun stu% S?
445mkdir mkdir ck_fun isTu@ S? S?
446rmdir rmdir ck_fun isTu% S?
447
448# Directory calls.
449
450open_dir opendir ck_fun is@ F S
332c2eac
JC
451readdir readdir ck_fun % DF
452telldir telldir ck_fun st% DF
453seekdir seekdir ck_fun s@ DF S
454rewinddir rewinddir ck_fun s% DF
455closedir closedir ck_fun is% DF
f8a58b02
NC
456
457# Process control.
458
459fork fork ck_null ist0
460wait wait ck_null isT0
461waitpid waitpid ck_fun isT@ S S
462system system ck_exec imsT@ S? L
1062548a 463exec exec ck_exec imsT@ S? L
9618b155 464kill kill ck_fun imsT@ L
f8a58b02
NC
465getppid getppid ck_null isT0
466getpgrp getpgrp ck_fun isT% S?
467setpgrp setpgrp ck_fun isT@ S? S?
468getpriority getpriority ck_fun isT@ S S
469setpriority setpriority ck_fun isT@ S S S
470
471# Time calls.
472
f8a58b02
NC
473time time ck_null isT0
474tms times ck_null 0
475localtime localtime ck_fun t% S?
476gmtime gmtime ck_fun t% S?
477alarm alarm ck_fun istu% S?
478sleep sleep ck_fun isT% S?
479
480# Shared memory.
481
482shmget shmget ck_fun imst@ S S S
483shmctl shmctl ck_fun imst@ S S S
484shmread shmread ck_fun imst@ S S S S
485shmwrite shmwrite ck_fun imst@ S S S S
486
487# Message passing.
488
489msgget msgget ck_fun imst@ S S
490msgctl msgctl ck_fun imst@ S S S
491msgsnd msgsnd ck_fun imst@ S S S
492msgrcv msgrcv ck_fun imst@ S S S S S
493
494# Semaphores.
495
496semop semop ck_fun imst@ S S
497semget semget ck_fun imst@ S S S
498semctl semctl ck_fun imst@ S S S S
499
500# Eval.
501
353d8d11 502require require ck_require dsu% S?
f8a58b02
NC
503dofile do "file" ck_fun d1 S
504hintseval eval hints ck_svconst s$
7d789282 505entereval eval "string" ck_eval du% S?
f8a58b02 506leaveeval eval "string" exit ck_null 1 S
f8a58b02
NC
507entertry eval {block} ck_eval d|
508leavetry eval {block} exit ck_null @
509
510# Get system info.
511
512ghbyname gethostbyname ck_fun % S
513ghbyaddr gethostbyaddr ck_fun @ S S
514ghostent gethostent ck_null 0
515gnbyname getnetbyname ck_fun % S
516gnbyaddr getnetbyaddr ck_fun @ S S
517gnetent getnetent ck_null 0
518gpbyname getprotobyname ck_fun % S
519gpbynumber getprotobynumber ck_fun @ S
520gprotoent getprotoent ck_null 0
521gsbyname getservbyname ck_fun @ S S
522gsbyport getservbyport ck_fun @ S S
523gservent getservent ck_null 0
524shostent sethostent ck_fun is% S
525snetent setnetent ck_fun is% S
526sprotoent setprotoent ck_fun is% S
527sservent setservent ck_fun is% S
528ehostent endhostent ck_null is0
529enetent endnetent ck_null is0
530eprotoent endprotoent ck_null is0
531eservent endservent ck_null is0
532gpwnam getpwnam ck_fun % S
533gpwuid getpwuid ck_fun % S
534gpwent getpwent ck_null 0
535spwent setpwent ck_null is0
536epwent endpwent ck_null is0
537ggrnam getgrnam ck_fun % S
538ggrgid getgrgid ck_fun % S
539ggrent getgrent ck_null 0
540sgrent setgrent ck_null is0
541egrent endgrent ck_null is0
542getlogin getlogin ck_null st0
543
544# Miscellaneous.
545
546syscall syscall ck_fun imst@ S L
547
548# For multi-threading
549lock lock ck_rfun s% R
550
551# For state support
552
553once once ck_null |
554
555custom unknown custom operator ck_null 0
556
deb8a388
FC
557# For CORE:: subs
558coreargs CORE:: subroutine ck_null $
88101882 559avhvswitch Array/hash switch ck_null t1
84ed0108
FC
560
561runcv __SUB__ ck_null s0
838f2281
BF
562
563# fc and \F
564fc fc ck_fun fstu% S?
ac217057
FC
565
566padcv private subroutine ck_null d0
ecf9c8b7 567introcv private subroutine ck_null d0
13f89586 568clonecv private subroutine ck_null d0
a7fd8ef6 569padrange list of private variables ck_null d0
6e372f32 570refassign lvalue ref assignment ck_refassign ds2
4b6cf48b 571lvref lvalue ref assignment ck_null d%
16b99412 572lvrefslice lvalue ref assignment ck_null d@
2882b3ff 573lvavref lvalue array reference ck_null d%
b77472f9 574anonconst anonymous constant ck_null ds1