mruby 3.4

Source: mrbgems/mruby-compiler/core/parse.y @ 3.4.0 (a309524) / lrama 0.8.0 / 2025-04-20

These diagrams describe a parser grammar, rather than the complete language specification. Lexer state and semantic checks may impose additional restrictions.

MIT

Readable Original grammar

$accept

$@1

program

top_compstmt

top_stmts

top_stmt

@2

bodystmt

compstmt

stmts

$@3

stmt

command_asgn

command_rhs

expr

defn_head

$@4

defs_head

expr_value

command_call

block_command

$@5

cmd_brace_block

command

mlhs

mlhs_inner

mlhs_basic

mlhs_item

mlhs_list

mlhs_post

mlhs_node

lhs

cname

cpath

fname

fsym

undef_list

$@6

op

reswords

arg

aref_args

arg_rhs

paren_args

opt_paren_args

opt_call_args

call_args

@7

command_args

block_arg

opt_block_arg

comma

args

mrhs

primary

@8

@9

$@10

$@11

@12

@13

$@14

$@15

$@16

$@17

$@18

$@19

@20

@21

@22

@23

primary_value

then

do

if_tail

opt_else

for_var

f_margs

$@24

block_args_tail

opt_block_args_tail

block_param

opt_block_param

$@25

block_param_def

opt_bv_decl

bv_decls

bvar

f_larglist

lambda_body

@26

do_block

block_call

method_call

@27

brace_block

@28

case_body

cases

opt_rescue

exc_list

exc_var

opt_ensure

literal

string

string_fragment

string_rep

string_interp

@29

xstring

regexp

heredoc

heredoc_bodies

heredoc_body

heredoc_string_rep

heredoc_string_interp

@30

words

symbol

basic_symbol

sym

symbols

numeric

variable

var_lhs

var_ref

backref

superclass

$@31

f_opt_arglist_paren

f_arglist_paren

f_arglist

f_label

f_kw

f_block_kw

f_block_kwarg

f_kwarg

kwrest_mark

f_kwrest

args_tail

opt_args_tail

f_args

f_bad_arg

f_norm_arg

f_arg_item

@32

f_arg

f_opt_asgn

f_opt

f_block_opt

f_block_optarg

f_optarg

restarg_mark

f_rest_arg

blkarg_mark

f_block_arg

opt_f_block_arg

singleton

$@33

assoc_list

assocs

assoc

operation

operation2

operation3

dot_or_colon

call_op

call_op2

opt_terms

opt_nl

rparen

trailer

term

nl

terms

none

Keyboard shortcuts

/ focuses search. j and k move between rules. ? opens this help. Escape closes it.