Jump to content
Sign in to follow this  
Shuhamly

Bison

Recommended Posts

akum,

sepa reti nak pakai bison?

aku dah install..tp x tau nak pakai mcm mana..

"Bison is a general-purpose parser generator that converts a grammar description for an LALR(1) context-free grammar into a C program to parse that grammar. Once you are proficient with Bison, you may use it to develop a wide range of language parsers, from those used in simple desk calculators to complex programming languages."

tu penerangan yg bison leh wat..tp aku tatau nak pakai

Share this post


Link to post
Share on other sites

erm..aku ada satu coding dlm c++..then dr coding tu nak kuar kan parse tree dlm phase syntax analysis..

x masuk lagi part semantic analysis...actually nie ada subjek compiler design..

ko reti?? penah pakai??

Share this post


Link to post
Share on other sites

actually aku tau kegunaan bison/flex/lex/yacc. tapi memang tak pernah guna pun and tak tau. yg aku peliknya cara ko bertanya tu mcm 1st time berforum. kalau tak reti guna, baca la manual dia. lepas baca manual (and cuba buat setakat termampu) baru la bertanya diforum kat mana ko stuck specifically. kalau tanya soalan general mcm tu kat mana2 forum, jawapan ko dapat biasanya RTFM.

Share this post


Link to post
Share on other sites

aku dah baca manual..and serius aku x phm..

actually aku xde la nak minta tlg A-Z

just bg aku guide...if aku dh dpt tangkap 1st step..

InsyaAllah..yg lain aku dah bole pick up...

just bgtau aku mcm mana nak start pakai bison..then aku akan wat sendiri..

bak ko kata..tanya part aku stuck..n part nak starting tu la aku stuck..

blur...baby yg lahir xde yg jln terus..kena pimpin dulu..then lama kelamaan

dia blaja bejln sendiri...same thing kat org2 mcm aku yg nak blaja..

pas dah pandai bejln..baby tu dah blaja belari..melompat etc...

klu aku dah tau mcm mana nak starting..InsyaAllah yg lain aku akan blaja sendiri...

peace~

Share this post


Link to post
Share on other sites

buat masa sekarang aku memang tak reti langsung pasal compiler construction and takde effort nak sentuh benda tu dalam masa terdekat walaupun aku berminat sket2.

yg aku nampak masalah en Shuhamly ni ialah u got no idea what u will do with bison. cadangan aku, back to root balik sebab ko dah lari jauh sebab dah tak nampak penghujung. root dia ialah compiler construction. so kena faham apa benda compiler ni, tugas dia mcm mana, mcm mana dia boleh jadi 'compiler', and mcm mana nak bina compiler. nak buat compiler kena tau la bahasa yg nak digunakan tu. sama ada bahasa yg dah wujud ataupun bahasa baru yg akan diwujudkan oleh en Shuhamly sendiri. nak buat compiler ni maksudnya anda dah melangkah jauh dari programmer2 biasa yg menggunakan compiler. programming knowledge en Shuhamly sepatutnya dah agak terrer especially dalam c/c++ (requirement nak pakai bison pun c/c++). solution dia, cari la buku2 yg pasal compiler construction theory, maybe dalam tu boleh nampak contoh simple2 pasal bison or atleast lex/yacc.

Share this post


Link to post
Share on other sites

okla..aku brief sket setakat mana yg aku tau pasal compiler design nie..

and aku rasa..bukan masalah aku x dpt overview pasal compiler nie..

masalah aku adalah...aku x de idea how bison works??? dats all....

actually ada byk tool aku leh guna...antara tools yg bole guna adalah..lec tool..yacc..bison..etc..

compiler dia ada byk phase..contoh la kita ada satu source code...then..source code tu akan melalui byk

phase..phase yg akan dilalui adalah

1)lexical analyzer

2)syntax analyzer

3)semantic analyzer

4)intermediate code generator

5)code optimizer

6)code generation...

dan..dlm byk2 phase..3 teratas adalah phase yg paling penting dan byk keja nak wat..

takkan aku nak citer satu persatu ke enamĀ² phase yg aku tulis tu..berapa muka surat pun

aku x tau...ambik masa 2 3 hari kot nak taip..

so dlm keenamĀ² phase tu..bison ni akan di gunakan kat part "lexical analyzer"

utk generate parse tree iaitu...samada LR parsing atau pun operator prcedence parsing..

so aku rasa..masalah aku bukan aku lari root or aku x phm konsep and im not saying dat aku nie

tau suma..x..tp at least overview..konsep mmg dah ada dlm pikiran skrg...maybe part bison dlm compiler

design nie adalah sgt kecik...tp sbb kan benda tu la..byk kekeliruan yg aku rasa..

anyway thanx bg pendapat...aku saja bg satu permasalahan pasal bison kat forum nie..kot2 sblm

aku jumpa org yg tau pasal bison..kat putera nie dah ada org yg bole ajar aku..thanx sbb membantu..

InsyaAllah i will share apa yg aku dpt pasal bison di forum nie akan datang...sekian wslm..

Share this post


Link to post
Share on other sites

aku tak sure laa jawapan camne yg hang nak. Tapi briefly, Bison, adalah parser generator (cam yacc) di mana input file kita adalah cfg yang menerangkan language tersebut (dalam sintaksis Bison). Dari input file nih, Bison generate laa kod C iaitu parser tersebut (a function called yyparse()). Output ni laa yang hang combine ngan lexical analyzer (yyparse call yylex(), yang hang tulis sendiri, atau bleh generate ngan lex) dan komponen2 lain dalam compiler hang untuk menghasilkan compiler lengkap untuk language hang. Tu jer kot. Nak pakai cam biasa laa.. tulis input file, invoke Bison dari command line. Manual Bison pun rasanya ader banyak penerangan termasuklah contoh rpcalc.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...