Christmas Parse Tree

First of all, I hope everyone is having a great holiday. I've been busy coding and have also been skiing/relaxing. My last post outlined my ideas for a language I wanted to play around with. I've been making progress on making it into a workable language! To show you my progress, and to celebrate the holidays, I thought I would put up a christmas parse tree for the following code block.

[1 to 10]()

p(n) => 11

identifier(arg1, arg2, ...) => do:

	z = {a: '10', b: '20', c: '30'}
	y = [1, 2, "3"]
	while:
		return()
    ;
;
a = -b
test = 1 + 2 + 3 + !x[1:5]
moo => 1 * (7/8)
  • (998)
    • (59)
      • 1
      • (0)
        • (18)
        • (0)
          • 10
          • (0)
    • (0)
      • (100)
        • (108)
          • (109)
          • (0)
        • (0)
      • (0)
        • p
          • (108)
            • n
            • (0)
          • (0)
            • (101)
              • 11
              • (0)
            • (0)
        • (0)
          • identifier
            • (108)
              • arg1
              • (0)
                • arg2
                • (0)
            • (0)
              • (101)
                • do
                  • (108)
                  • (0)
                    • (101)
                      • (24)
                        • z
                        • (107)
                          • (58)
                            • (0)
                              • a
                                • (0)
                                  • 10
                                  • (0)
                              • (0)
                                • b
                                  • (0)
                                    • 20
                                    • (0)
                                • (0)
                                  • c
                                    • (0)
                                      • 30
                                      • (0)
                                  • (0)
                          • (0)
                      • (0)
                        • (24)
                          • y
                          • (107)
                            • (59)
                              • 1
                              • (0)
                                • 2
                                • (0)
                                  • 3
                                  • (0)
                            • (0)
                        • (0)
                          • while
                            • (108)
                            • (0)
                              • (101)
                                • return
                                  • (108)
                                    • (109)
                                    • (0)
                                  • (0)
                                • (0)
                              • (0)
                          • (0)
                    • (0)
                • (0)
              • (0)
          • (0)
            • (24)
              • a
              • (107)
                • (41)
                  • b
                  • (0)
                • (0)
            • (0)
              • (24)
                • test
                • (107)
                  • 1
                  • (0)
                    • 2
                    • (0)
                      • 3
                      • (0)
                        • (26)
                          • x
                          • (0)
                            • (106)
                              • 1
                              • (0)
                                • 5
                                • (0)
                            • (0)
                        • (0)
              • (0)
                • (23)
                  • moo
                  • (0)
                    • (102)
                      • 1
                      • (0)
                        • 7
                        • (0)
                          • 8
                          • (0)
                    • (0)
                • (999)

Happy Holidays!

Add a Comment