View Single Post
  #14   Spotlight this post!  
Unread 21-04-2011, 11:57
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Hibner: Flexible, Scripted Autonomous Control

Quote:
Originally Posted by wireties View Post
A lexer and parser in LabVIEW? This might get ugly... ;o)
I wrote a script interpreter in LabVIEW, it's not ugly at all. It looks very nice, actually.
It reads the text file, splits it into lines, then parses it line by line.
Foreach line, it determines if it is a comment or contains less than 3 characters (and skips it if it does), then splits up the line's text by spaces, taking the first block of text and finding a command with that name, and calling it byref and feeding it the arguments (the rest of the text) as an array of strings. Generally, the functions either take those strings and turn them into doubles, or compare them to constants (to determine an enumerated type).
I spent a little while debugging it on Windows before running it on a robot, and most of my errors were from not initializing shift registers.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack