⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Racc
/
View File Name :
cdesc-Racc.ri
U:RDoc::NormalModule[iI" Racc:ET@0o:RDoc::Markup::Document:@parts[o;;[ : @fileI"ext/racc/cparse/cparse.c;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"lib/racc/debugflags.rb;T; 0o;;[ ; I"lib/racc/exception.rb;T; 0o;;[ ; I"lib/racc/grammar.rb;T; 0o;;[ ; I""lib/racc/grammarfileparser.rb;T; 0o;;[ ; I"lib/racc/info.rb;T; 0o;;[ ; I"lib/racc/iset.rb;T; 0o;;[ ; I"!lib/racc/logfilegenerator.rb;T; 0o;;[ ; I"lib/racc/parser-text.rb;T; 0o;;[ ; I"lib/racc/parser.rb;T; 0o;;[Io:RDoc::Markup::Paragraph;[I")Racc is a LALR(1) parser generator. ;TI"?It is written in Ruby itself, and generates Ruby programs.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"Command-line Reference;T@.o:RDoc::Markup::Verbatim;[I"Fracc [-o
filename
] [--output-file=
filename
] ;TI"E [-e
rubypath
] [--executable=
rubypath
] ;TI" [-v] [--verbose] ;TI"C [-O
filename
] [--log-file=
filename
] ;TI" [-g] [--debug] ;TI" [-E] [--embedded] ;TI"# [-l] [--no-line-convert] ;TI"$ [-c] [--line-convert-all] ;TI"# [-a] [--no-omit-actions] ;TI" [-C] [--check-only] ;TI"! [-S] [--output-status] ;TI"D [--version] [--copyright] [--help]
grammarfile
;T:@format0o:RDoc::Markup::List: @type: LABEL:@items[o:RDoc::Markup::ListItem:@label[I"+grammarfile+;T;[o;;[I"3Racc grammar file. Any extension is permitted.;To;;[I")-o+outfile+, --output-file=+outfile+;T;[o;;[I":A filename for output. default is <+filename+>.tab.rb;To;;[I"(-O+filename+, --log-file=+filename+;T;[o;;[I".Place logging output in file +filename+. ;TI"2Default log file name is <+filename+>.output.;To;;[I"*-e+rubypath+, --executable=+rubypath+;T;[o;;[I"Loutput executable file(mode 755). where +path+ is the Ruby interpreter.;To;;[I"-v, --verbose;T;[o;;[I"Lverbose mode. create +filename+.output file, like yacc's y.output file.;To;;[I"-g, --debug;T;[o;;[I"Fadd debug code to parser class. To display debuggin information, ;TI"@use this '-g' option and set @yydebug true in parser class.;To;;[I"-E, --embedded;T;[o;;[I"EOutput parser which doesn't need runtime files (racc/parser.rb).;To;;[I"-C, --check-only;T;[o;;[I"0Check syntax of racc grammar file and quit.;To;;[I"-S, --output-status;T;[o;;[I"1Print messages time to time while compiling.;To;;[I"-l, --no-line-convert;T;[o;;[I"&turns off line number converting.;To;;[I"-c, --line-convert-all;T;[o;;[I">Convert line number of actions, inner, header and footer.;To;;[I"-a, --no-omit-actions;T;[o;;[I"2Call all actions, even if an action is empty.;To;;[I"--version;T;[o;;[I"!print Racc version and quit.;To;;[I"--copyright;T;[o;;[I"Print copyright and quit.;To;;[I"--help;T;[o;;[I"Print usage and quit.;T@.S; ;i;I"!Generating Parser Using Racc;T@.o;;[I"/To compile Racc grammar file, simply type:;T@.o;;[I"$ racc parse.y ;T;0o;;[I"_This creates Ruby script file "parse.tab.y". The -o option can change the output filename.;T@.S; ;i;I" Writing A Racc Grammar File;T@.o;;[ I"DIf you want your own parser, you have to write a grammar file. ;TI"TA grammar file contains the name of your parser class, grammar for the parser, ;TI"#user code, and anything else. ;TI"?When writing a grammar file, yacc's knowledge is helpful. ;TI"AIf you have not used yacc before, Racc is not too difficult.;T@.o;;[I")Here's an example Racc grammar file.;T@.o;;[I"class Calcparser ;TI" rule ;TI"$ target: exp { print val[0] } ;TI" ;TI" exp: exp '+' exp ;TI" | exp '*' exp ;TI" | '(' exp ')' ;TI" | NUMBER ;TI" end ;T;0o;;[ I"-Racc grammar files resemble yacc files. ;TI")But (of course), this is Ruby code. ;TI"-yacc's $$ is the 'result', $0, $1... is ;TI"Ian array called 'val', and $-1, $-2... is an array called '_values'.;T@.o;;[I"RSee the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for ;TI"'more information on grammar files.;T@.S; ;i;I"Parser;T@.o;;[I"JThen you must prepare the parse entry method. There are two types of ;TI"Jparse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse;T@.o;;[I"%Racc::Parser#do_parse is simple.;T@.o;;[ I"EIt's yyparse() of yacc, and Racc::Parser#next_token is yylex(). ;TI"FThis method must returns an array like [TOKENSYMBOL, ITS_VALUE]. ;TI"EOF is [false, false]. ;TI"J(TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default. ;TI";If you want to change this, see the grammar reference.;T@.o;;[I"=Racc::Parser#yyparse is little complicated, but useful. ;TI"WIt does not use Racc::Parser#next_token, instead it gets tokens from any iterator.;T@.o;;[I":For example,
yyparse(obj, :scan)
causes ;TI"Tcalling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.;T@.S; ;i;I"Debugging;T@.o;;[I"
Note: parser.rb is ruby license, but your parser is not. ;TI")Your own parser is completely yours.;T; @'; 0o;;[ ; I"$lib/racc/parserfilegenerator.rb;T; 0o;;[ ; I"lib/racc/sourcetext.rb;T; 0o;;[ ; I"lib/racc/state.rb;T; 0o;;[ ; I"%lib/racc/statetransitiontable.rb;T; 0; 0; 0[ [U:RDoc::Constant[i I"GrammarFileParser;TI"Racc::GrammarFileParser;T:public0o;;[ ; @; 0@@cRDoc::NormalModule0U;[i I"VERSION;TI"Racc::VERSION;T;0o;;[ ; @; 0@@@<0U;[i I"Version;TI"Racc::Version;T;0o;;[ ; @; 0@@@<0U;[i I"Copyright;TI"Racc::Copyright;T;0o;;[ ; @; 0@@@<0U;[i I"PARSER_TEXT;TI"Racc::PARSER_TEXT;T;0o;;[ ; @$; 0@$@@<0U;[i I"StateTransitionTable;TI"Racc::StateTransitionTable;T;0o;;[ ; @3; 0@3@@<0[ [[I" class;T[[;[ [:protected[ [:private[ [I" instance;T[[;[ [;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[@@@@@@@@!@$@'@*@-@0@3@3cRDoc::TopLevel