Parsing Bottom Up - Computerphile

  Рет қаралды 77,755

Computerphile

Computerphile

4 жыл бұрын

Having explained the top-down method, Professor Brailsford flips to bottom up Parsing.
EXTRA BITS: • EXTRA BITS: YACC & LEX...
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Пікірлер: 92
@gravity4606
@gravity4606 4 жыл бұрын
I can't wait until they finish the "Middle-Out Parsing Method"
@andy.robinson
@andy.robinson 4 жыл бұрын
Didn't Richard Hendricks already solve that? 🙂
@arbazna
@arbazna 4 жыл бұрын
Nice "Dragon book" in the background
@fn24atradio
@fn24atradio 4 жыл бұрын
I still have mine.
@big_b_radical3985
@big_b_radical3985 4 жыл бұрын
As iconic as computer graphics, principles and practices.
@pm31415
@pm31415 4 жыл бұрын
He is like the david attenborough of computers
@EternalAnomaly
@EternalAnomaly 4 жыл бұрын
Paul McKeown 100% Imagine both of them in one video. Thats my ASMR dream video! 😁
@chaoslab
@chaoslab 4 жыл бұрын
Always an awesome day when their is a new Prof Brailsford video posted. :-)
@krishnabirla
@krishnabirla 4 жыл бұрын
I want to meet him just for once in my life. I love him.
@olavl8827
@olavl8827 4 жыл бұрын
Perhaps write him an e-mail? His address can be found easily on the university's web site.
@domminney
@domminney 4 жыл бұрын
He’s a great guy.
@i1a2159
@i1a2159 4 жыл бұрын
Thank you for these amazing and helpful videos!
@crumbl3d
@crumbl3d 4 жыл бұрын
Well just had a curriculum for a Compilers class last week and parsing was the main event but I guess a different point of view is always useful.
@theassailer18
@theassailer18 4 жыл бұрын
I have your 'Dragon Book', and i learned bottom-up parsing from that one :) Thank you!
@TheDarkOne629
@TheDarkOne629 3 жыл бұрын
Tanks for the explanation. I always thought that bottom-up meant walking the AST from the bottom leaves up to the root and just could not wrap my head about it. Anyone I asked just said "Well, it goes from the bottom to the top."
@ATG549
@ATG549 4 жыл бұрын
This is actually crazy, this video went up as soon as I finished watching the original parsing video, what are the odds :P
@Shadow81989
@Shadow81989 4 жыл бұрын
At <a href="#" class="seekto" data-time="255">4:15</a> or so he should have mentioned that the next thing the parser would try to match (and fail to do so) would be "the robot stroked", in order to make sure that there's no longer chunk decodable rightaway. Other than that minor detail, great video, as usual from Professor Brailsford!
@d7oo435
@d7oo435 4 жыл бұрын
Will, windows 7 looks lovely
@zxuiji
@zxuiji 4 жыл бұрын
what about multi parsing? Identify objects, verbs and adjectives 1st while placing identifiers between each (I think the xml word work well there) and then recursively parse each section or subsection until no more sections can be made and then build the subject etc from what the combined information says, when no subject can be found then the precious context is used, if no previous context is used then a question can be generated to ask what/who etc was the verb etc relates to
@vozzen
@vozzen 4 жыл бұрын
They upload this the same day I had a lecture about it. That's quite a coincidence.
@dovidsamuels5709
@dovidsamuels5709 4 жыл бұрын
Me too! That's crazy...
@iamjimfan
@iamjimfan 3 жыл бұрын
I learned parsing using bison and thus the shift-reduce approach. Just now I was doing ANTLR 4 but LL parsing really looks like an alien to me.
@ShakaRule
@ShakaRule 4 жыл бұрын
It bothers me that you show the stack sideways xD
@olbluelips
@olbluelips 4 жыл бұрын
Jelmer Berghs it’s going to spill everywhere :(
@CJBurkey
@CJBurkey 4 жыл бұрын
The odds are stacked against you
@x3ICEx
@x3ICEx 4 жыл бұрын
The extra bits are STILL unlisted. I'm not hunting around in video descriptions for links... EXTRA BITS: YACC & LEX background - Computerphile Unlisted 4,401 views•Nov 27, 2019
@HisMajesty99
@HisMajesty99 4 жыл бұрын
Lol I just finished a Parser project using YACC for a Compilers course. Had exactly to do with this.
@Endomorphism
@Endomorphism 2 жыл бұрын
is its online course ?
@tscoffey1
@tscoffey1 4 жыл бұрын
Rather than shifting characters, you actually shift lexical tokens onto the stack. (The lexical analyzer determined the token values, using a fairly simple finite state machine)
@jpratt8676
@jpratt8676 4 жыл бұрын
To be a bit more complete, not all parsers have lexers. You can parse from raw characters (not that I recommend it, too many edge cases that you could have simplified with lexing).
@tscoffey1
@tscoffey1 4 жыл бұрын
@@jpratt8676 Correct, but why not deal with the special cases using a much simpler FSM, instead of trying to put those rules into the parser?
@jpratt8676
@jpratt8676 4 жыл бұрын
@@tscoffey1 I totally agree, but that doesn't change the terminology, only the approaches that we believe are reasonable.
@dstarfire42
@dstarfire42 4 жыл бұрын
Since the start of the 'top-down parsing' I've assumed most compilers used a combination of these approaches. Is that accurate, or does it vary from compiler to compiler?
@iamjimfan
@iamjimfan 3 жыл бұрын
I think not. Try take a look at ANTLR which generates parser using top-down approach. I am trying to get familiarised with it.
@stark_energy
@stark_energy 6 ай бұрын
Some custom compilers like Android does to IntelliJ editor has put optimization code to trim off several impossibility (such as trimming possibility of parsing Statement tree outside of class scope in Java) this will skip the checking of heavy potential top-down branch by big margin. So the answer is that if that app has significantly faster performance than standard/other compiler, a custom (maybe a combination of both top-down, pruning and bottom-up) compiler was made to tuned to that specific language (e.g. special for Java). Compiler in editor such as in Dreamweaver or Eclipse is slow because those editors are for general language (either bottom up or top down) without optimization.
@TheRealGuywithoutaMustache
@TheRealGuywithoutaMustache 4 жыл бұрын
I don’t know anything about this topic, but I’m interested
@sakeriyasaleh4820
@sakeriyasaleh4820 4 жыл бұрын
Same
@rylaczero3740
@rylaczero3740 4 жыл бұрын
We had a dedicated subject for them in Uni under 'Compilers'
@paneesh
@paneesh 4 жыл бұрын
His sweater has, what looks like, a lot of cat fur :D
@olavl8827
@olavl8827 4 жыл бұрын
Yes, saw it too and when I did it became somewhat distracting. I believe the person operating the camera should be alert to such things. For this channel the people being filmed probably don't need to be in full TV-studio makeup. But at least dust them off a little, pay some mind to their appearance.
@paneesh
@paneesh 4 жыл бұрын
@@olavl8827 I found it funny. Professor probably cuddled with his cat and never realized the trail of fur it left behind :)
@caleb5688
@caleb5688 9 ай бұрын
I don't think Dr Knuth knows how sus "the robot stroked two furries" sounds
@ravewulf
@ravewulf 4 жыл бұрын
Sounds a bit like regular expressions in that regex is greedy/looking for the longest match (unless you tell it to be lazy)
@JmanNo42
@JmanNo42 4 жыл бұрын
Hello Professor Brailsford, if you have a large dataset is there a speed penalty for the bottom up approach, or is it same or faster parsing?
@JmanNo42
@JmanNo42 4 жыл бұрын
I was thinking parsing the words and later match two words with string may be faster, the doing the full character match of sting because the dataset will be the comarissons and the the more "simialar strings" the more comparissons? Less comparissons? So if you wrote an AI that could handle that type of sematnic buliding blocks, it would take a very long time doing the matching bottom up finding combined words in phrases? Right or wrong?
@JmanNo42
@JmanNo42 4 жыл бұрын
Well thiese type of ideas certainly was in the era of administrative programming back in the day "expertsystem and automatiion", what happened to them are they still prevalent?
@simpletongeek
@simpletongeek 4 жыл бұрын
Does that mean if the phrase is "the robot stroke the robot", then we will get 2 subjects? Or is there a workaround for that kind of problems?
@profdaveb6384
@profdaveb6384 4 жыл бұрын
Yes if the shortcut phrase "the robot" was allowed in an object position you might end up reducing that to and end up with "two subjects" in your sentence.. A simple-minded bottom-up parser might well end up with and then have to backtrack and try again because the final goal *must* be . Nothing else will do. But the parser that yacc will generate for you takes great care, by reordering the input grammar and "looking ahead" a little,, to take you only through those reductions that might eventually result in .
@HechTea
@HechTea 4 жыл бұрын
*Notices furry* OwO what's this?
@RufusShinraPower
@RufusShinraPower 4 жыл бұрын
It's a compiler for the furry language =p
@DonovanDMC
@DonovanDMC 4 жыл бұрын
I'm half expecting that youtube user just called "OwO" to pop up out of nowhere
@exoticcoder5365
@exoticcoder5365 3 жыл бұрын
<a href="#" class="seekto" data-time="632">10:32</a> I was concerned about that teddy bear behind
@schumbo8324
@schumbo8324 4 жыл бұрын
Why this catches my attention and makes me watch it all as a law student someone needs to explain this to me!!
@Not.Your.Business
@Not.Your.Business 4 жыл бұрын
subconscious mind having doubts regarding career choice, maybe?
@schumbo8324
@schumbo8324 4 жыл бұрын
@@Not.Your.Business Ehm i dont think i have a regret about my profession choice but i still like to listten about these stuff. This must be more like attraction of unknown.. i guess.
@eschelon9067
@eschelon9067 4 жыл бұрын
Next up: Bottom Up AI vs Bottom Down AI explained
@DonovanDMC
@DonovanDMC 4 жыл бұрын
The word "furry" is used too much here
@mfbx9da4
@mfbx9da4 3 жыл бұрын
Dudes got a cat...
@rpcruz
@rpcruz 4 жыл бұрын
He uses Windows? I was expecting to see Minix or some other weird Unix variant hehe.
@NoNameAtAll2
@NoNameAtAll2 4 жыл бұрын
unix is good for proffesional work windows is good for normal work
@Dong_Harvey
@Dong_Harvey 4 жыл бұрын
To note Windows 7, still better than 10 BTW I just learned about PureDarwin today, check out it's logo
@KuraIthys
@KuraIthys 4 жыл бұрын
He used a terminal program in windows to SSH into a Linux system. Is that heresy? Or is it pragmatism? ;p
@daveachuk
@daveachuk 4 жыл бұрын
... or just use S-expressions #lisp4lyfe
@Jeacom
@Jeacom 4 жыл бұрын
I'll never understand why computer science trees are upside down.
@carlosmendes7
@carlosmendes7 3 жыл бұрын
Easier to draw on paper without wasting space
@Jeacom
@Jeacom 3 жыл бұрын
@@carlosmendes7 I dont think that's an excuse to make millions of students confused.
@b2gills
@b2gills 3 жыл бұрын
It's because written English starts at the top left of the paper. You start with the first thing you know, which is the root. You write that first, because you know it first. Then you follow the branches, which you know second, so you write it second. Eventually you get to the leaves last, so you write them last. Which means they end up at the bottom.
@Jeacom
@Jeacom 3 жыл бұрын
@@b2gills So why not call it a root instead of a tree? The, bottom-up top-down terminology would be so much easier to get that way.
@b2gills
@b2gills 3 жыл бұрын
@@Jeacom Because English doesn't have names for roots that branch, and for the ends of roots. English DOES have plenty of words to describe branches and leaves. (Mainly because people speaking English as it was developing rarely if ever saw the roots of a tree.) I mean it is easier to say: “start at the root of the tree, work your way along the branches until you get to the leaves.” It isn't very easy to understand: “start at the root of the root, work your way along the roots until you get to the roots.” Basically we use the word tree because we have words to describe that.
@pruusnhanna4422
@pruusnhanna4422 4 жыл бұрын
Flex & bison.
@profdaveb6384
@profdaveb6384 4 жыл бұрын
Yep! My SuSe Linux (apparently) supplies "lex" and "yacc" but they are redirected via shellscript interfaces to flex and bison. Main thing to remember is that this aliasing does not seemingly extend to libraries. On my setup, at least, you can't get away with '-ll' The link-loader insists on '-lfl'
@pierreabbat6157
@pierreabbat6157 4 жыл бұрын
two furry dice stroked the robot
@pmcgee003
@pmcgee003 4 жыл бұрын
I'm thinking the screen text has been CGI'd in, over the actual screen text ... and then some focus blur added on the edge just as a flex. :)
@spoonikle
@spoonikle 4 жыл бұрын
using windows 7 to ssh into your linux server.
@baileyharrison1030
@baileyharrison1030 4 жыл бұрын
spoonikle that’s how most people seem to do it.
@MrNacknime
@MrNacknime 4 жыл бұрын
This grammar is such a bad example. Nowhere is there any ambiguity in what kind of rule produced a certain result. It would be much more interesting to see how the parser handles it when there are currently two possibilities producing a certain handle, and how this is resolved when more of the input is considered.
@muninmatt
@muninmatt 4 жыл бұрын
Someone get this man a lint roller
@justahker3988
@justahker3988 4 жыл бұрын
Speaking of which, I would love to have an episode on linters and how they differ in purpose from compilers.
@gohchi
@gohchi 4 жыл бұрын
deep inside everyone loves the furries. okno
@dipi71
@dipi71 4 жыл бұрын
Considering the target group of these videos, I doubt it’s necessary to »protect« us from those too intricate »extra« details anymore. When those »EXTRA BITS« (all caps, ugh!) begin to be the actual meat of the matter, the »main« videos remain little more than fluffy preludes. Therefore I suggest integrating the extra bits and the preludes to proper videos about one topic. No to channel hopping.
@TarasMazepa
@TarasMazepa 4 жыл бұрын
Bottom up grammar parsing
@anthonyvays5786
@anthonyvays5786 4 жыл бұрын
putty on windows 7 in 2019
@DamonWakefield
@DamonWakefield 4 жыл бұрын
First for once!
@naufragio5842
@naufragio5842 4 жыл бұрын
If you wanna try this stuff under your linux boxes look for bison+flex lol.
@neozeus2222
@neozeus2222 4 жыл бұрын
first!
@abdallahmanasrah2317
@abdallahmanasrah2317 4 жыл бұрын
You win good sir
@derHutschi
@derHutschi 4 жыл бұрын
nice video. it has furries ;-)
Functional Parsing - Computerphile
22:46
Computerphile
Рет қаралды 134 М.
Parsing Explained - Computerphile
14:58
Computerphile
Рет қаралды 239 М.
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 6 МЛН
Tom & Jerry !! 😂😂
00:59
Tibo InShape
Рет қаралды 55 МЛН
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 19 МЛН
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 68 МЛН
Regular Expressions - Computerphile
17:19
Computerphile
Рет қаралды 239 М.
Bootstrapping with T-Diagrams - Computerphile
15:49
Computerphile
Рет қаралды 165 М.
Where did Bytes Come From? - Computerphile
11:31
Computerphile
Рет қаралды 474 М.
NES Emulator Part #2: The CPU (6502 Implementation)
1:07:12
javidx9
Рет қаралды 414 М.
'Accidental' CrossCompiler - Computerphile
15:13
Computerphile
Рет қаралды 109 М.
Military Grade C/C++ Lexer from Scratch
2:27:18
Tsoding Daily
Рет қаралды 47 М.
Recursion 'Super Power' (in Python) - Computerphile
12:18
Computerphile
Рет қаралды 488 М.
The UNCOL Problem - Computerphile
11:42
Computerphile
Рет қаралды 79 М.
Visualisation of Facebook outage in BGPlay - 4 October 2021
1:23
Parsing - Computerphile
6:57
Computerphile
Рет қаралды 166 М.
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 6 МЛН