Making a Programming Language with C# and ANTLR4

Поделиться
HTML-код
  • Опубликовано: 8 ноя 2024

Комментарии • 41

  • @crunchyduck
    @crunchyduck Год назад +7

    Using this video as a companion to learn antlr; I adore your presenting style. You sound like you're having a lot of fun doing this, and it makes me have fun too.

  • @darkcat013
    @darkcat013 2 года назад +5

    Thanks! Consider posting more content about ANTLR4 and C#, I learned a lot from this video😁

  • @Rocky1138
    @Rocky1138 2 года назад +2

    Perfect timing. I did a search on RUclips just 3 hours after you posted this :) Thanks. Giving it a watch now.

  • @lewisbrowne8799
    @lewisbrowne8799 2 года назад +5

    really a great tutorial, been at this for weeks now trying to figure out the utilty of my grammar in a context other than using GRun. You've really saved my ass!

  • @MrVoltastic
    @MrVoltastic 2 года назад +3

    Great video! To answer your question about the grammar, Uppercase and lowercase define the semantic and lexical parts of the grammar used by the scanner/parser(compiler front-end ANTLR generates). lower case are non-terminal (are not atomic - expression can have more expressions), uppercase are terminal nodes in the AST tree the parser generates (are atomic IDENTIFIER = [regular expression]).There are also fragments, which I believe are called sugar code lol

    • @oysteinsoreide4323
      @oysteinsoreide4323 Год назад

      Yes, casing should be handled in the lexer, not the grammar.

  • @7th_CAV_Trooper
    @7th_CAV_Trooper 10 месяцев назад

    You can model expression trees in JSON, but it gets unwieldy pretty fast. Just did this for a work project - mostly used expressions as a way to teach some ideas to a junior dev. Of course, I got around to thinking how much easier it would be to use a little lambda calculus language instead of JSON. Next thing you know I'm watching this cool video.

  • @DeznekCZ
    @DeznekCZ 2 года назад

    Finally I had an possibility to start my dream lang 🙂
    Is now breaking on regexes, which are different from every else, but im going to target.
    Thanks to you and Antlr4C#

  • @7th_CAV_Trooper
    @7th_CAV_Trooper 9 месяцев назад

    Watching this again and thinking that the integer zero begins with the digit '0'
    I enjoy the narrator's sense of humor :)

  • @thekidgaming6174
    @thekidgaming6174 7 месяцев назад +1

    Loved this 😂 Especially the rant about horses 😂

  • @BryanChance
    @BryanChance 11 месяцев назад

    Right on.. using blank space/tab/indent as part of syntax is a terrible idea.. whoever thought that was a good idea? LOL Great video!!

  • @takudzwamupanesure3222
    @takudzwamupanesure3222 Год назад

    Thanks mate, this was interesting indeed. I learnt a lot and I added my own twist its interesting.

  • @slBrelaz
    @slBrelaz 2 года назад +2

    Yay I've been thinking of writing my own programming language for my game.

    • @alexisrodriguez7127
      @alexisrodriguez7127 2 года назад

      Language or engine?

    • @slBrelaz
      @slBrelaz 2 года назад

      @@alexisrodriguez7127 I'm already part way through the second one. Planning to also add the first one as an in-game programming language.

    • @ENG1MA
      @ENG1MA Год назад

      @@slBrelaz same

  • @Hellomoneyful
    @Hellomoneyful 7 месяцев назад +1

    Nice content, thanks mate!

  • @FriedMonkey362
    @FriedMonkey362 Год назад

    This is like a programming podcast ur talking about horses lol
    Good stuff

  • @mrmaniac9905
    @mrmaniac9905 Год назад

    Good video, but the way you use the antlr generated visitor is questionable.. you are treating it like a listener and will likely have side-effect as you're storing state within the visitor. With the visitor pattern you're supposed to have x number of visitors for each generalized task within your program. For example you will have a expression visitor that returns an expression type. The expression type will then have sub types such as a constant expression visitor. The expression visitor would then delegate it's visit constant calls to the constant expression visitor. This way you're generating ast, (in this example expression visitor returns expressions, and the constant visitor would return a constant expression, which is a child of an expression.)

  • @Esgarpen
    @Esgarpen 2 года назад

    Taking a course where we use antlr4, listeners & visitors.. but in Java.... as I have no experience in Java I barely understand my teacher's ppt slides and demonstrations... Thank you for showing how to do it in c# so I can understand what we are doing... now I just gotta figure out how to Java 🤣

  • @mnk4214
    @mnk4214 7 месяцев назад +1

    Is the code for this project on GitHub?

  • @davidpozo3375
    @davidpozo3375 3 месяца назад

    I think there's a way to generate C# routines by giving .g4 file as input, does anybody knows to do that ?

  • @h_geen
    @h_geen 2 года назад +1

    i don't understand the class part at all, i get an error when i try to use what is in the content folder

    • @sevilayceker2133
      @sevilayceker2133 Год назад

      Did you solve this problem? I am also having the same problem

  • @anwarsh5195
    @anwarsh5195 2 года назад

    did you make a compiler in another video??

  • @thejuicedorange9317
    @thejuicedorange9317 2 года назад

    For the idea of func = @(){ asdasd } how would I go about implementing something like that

  • @thedemonicstaff7417
    @thedemonicstaff7417 Год назад

    15:04 you used * which can repeat at least 0 times, you shoupd use a + which needs atleast one instance.

  • @ammarahmed175
    @ammarahmed175 2 года назад +2

    Can you share your code?

  • @0xgrand
    @0xgrand 2 года назад

    Thanks for the great tutorial! How would you visit(code) the if/else if/else block? I'm struggling with that :\

    • @ikryxxdev4756
      @ikryxxdev4756 Год назад

      put this in your override:
      Func condition = isTrue;
      if (condition(Visit(context.expression())))
      {
      Visit(context.block());
      }
      else
      {
      Visit(context.elseIfBlock());
      }
      return null;

  • @ammarahmed175
    @ammarahmed175 2 года назад

    Good Tutorial.

  • @windows1.0
    @windows1.0 Год назад

    Python has while... else!

  • @radthadd
    @radthadd 2 года назад

    Cool video. I'm tying this into Godot. Hope it works

  • @HissyGaming
    @HissyGaming 2 года назад

    Time to make H-

  • @Ice-fl9et
    @Ice-fl9et 2 года назад +1

    what’s your ide

  • @Donclion911
    @Donclion911 Год назад

    a programming language on top of c#....? omg

  • @rojoliberticida
    @rojoliberticida 5 месяцев назад

    41:36

  • @Whosaidsneedfirst
    @Whosaidsneedfirst Год назад

    DID YOU MADE YOUR OWN COMPILER AND KERNEL ???? NNNNN
    ERR??