Author

Topic: Bitcoin Script language grammar? (Read 407 times)

legendary
Activity: 2128
Merit: 1073
November 18, 2017, 03:09:46 PM
#4
Thanks for your explanation, do you think it'll be worth trying to do it for the ethereum solidity language ??
Yeah, with Solidity the context-free grammars are the proper tool-set to for the problem domain.

You'd really will have to discuss this with your scientific advisor at your school. They will need to help you select a project with the proper difficulty level for your school and your degree. My advice is: prepare a palette of possible projects, some too trivial (like your original idea), some too complex, and have have a discussion with the a teacher at your school who knows you and who will grade your coursework.
full member
Activity: 268
Merit: 119
November 18, 2017, 02:54:33 PM
#3
Thanks for your explanation, do you think it'll be worth trying to do it for the ethereum solidity language ??
legendary
Activity: 2128
Merit: 1073
November 18, 2017, 02:02:05 PM
#2
The context-free grammar is trivial, just a concatenation of lexical elements (alphabet symbols). All the expressive power is contained in the context (in this case, the contents of the stacks). It is equivalent to a simple RPN (reverse-polish notation) calculator, it doesn't even use parentheses for disambiguating the order of operations.

Since you've mentioned "university course": the formal languages aren't a good tool to analyze simple stack machines like the one in Bitcoin. You would just waste time trying to analyze it at this level. Search for another, more productive, subject for your coursework.
full member
Activity: 268
Merit: 119
November 18, 2017, 11:08:43 AM
#1
This wiki page contain pretty much helpful info: https://en.bitcoin.it/wiki/Script  since it has all the 'words' accepted in the scripting language.
However, I was wondering if there's something like a grammar to this language? something like the grammar used to build parse tree for other languages.

Reason I'm looking for this is that I have a project at university for the compilers course, so I was looking into building a parse tree for the bitcoin scripts.

Thanks in advance.
Jump to: