Posts

Showing posts from February, 2022

Week 2

 Week 2 I was tasked to actually make the scanner, so I took the scanner that we did in class, copy and pasted to another file and started to look at the text and Identify the super fiscal things of the code. The keywords, the letters used, the punctuation, numbers, etc. I'm making the scanner print out numbers for what it sees so for">" it might print "4" so I know it recognized it as what I want it to. Learning from my first scanner and make sure that it takes spaces, tabs, comments, and doesn't bug out. It also takes anything unknown and prints it so I know it doesn't recognize it, until its all numbers and it makes the pattern that I want. The next step will be to make the grammar and create a parser for the language. I've made some progress on the scanner and trying to debug because I'm having trouble running the scanner. rnum { printf("1: %s\n", yytext) ;} str { printf("3: %s\n", yytext); } [-+]?[0-9]*\.[0-9]+ {printf...

Week 1

 The first week I decided to research algorithms, but before I do the research I'm doing a side project and building a scanner, and BNF for a small language I create. The project idea was bought up by my 240 professor because we were using regular expression to finish a scanner and scan his already own made language, emcee. This idea followed by the TRAIN meeting sparked my interest to try and complete this project. So, after some thinking I built a small program that checks Pythagorean theorem numbers. So far I've learned how to do regular expressions and vaguely what a scanner should look like and how to implement it into my terminal on my raspberry pi. I still need to how a general vision of my language so I can define possible future variables just in case I wanna expand and try to make the language more complex.  #pythagorean theorem checker rnum a > 4; rnum b > 3; rnum c > 5; #pythag=a^2 + b^2 =c^2 #checks the numbers if(c^2>(a^2+b^2)) { str String > "...