generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: SO MUCH PARSER PROGRESS :D

Previous Thread :: Next Thread 
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
09 Jan 2016 11:58 PM
this:

// first estrela file!

if (10 * 10 > 20) {
if (x == true) {

}
if (y == "Hello!") {

}
}


parses into this:


typeof = ROOT
block = {
{
typeof = IF
block = {
{
typeof = IF
block = {
}
condition = {
{
typeof = IDENTIFIER
word = x
}
{
typeof = EQUAL_TO
}
{
typeof = IDENTIFIER
word = true
}
}
}
{
typeof = IF
block = {
}
condition = {
{
typeof = IDENTIFIER
word = y
}
{
typeof = EQUAL_TO
}
{
typeof = DOUBLE_QUOTE
}
{
typeof = IDENTIFIER
word = Hello
}
{
typeof =
}
{
typeof = DOUBLE_QUOTE
}
}
}
}
condition = {
{
typeof = NUMBER
word = 10
}
{
typeof = MULTIPLY
}
{
typeof = NUMBER
word = 10
}
{
typeof = GREATER_THAN
}
{
typeof = NUMBER
word = 20
}
}
}
}
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
10 Jan 2016 12:00 AM
i'm not going to say im a hero

but i hope someone else does
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
10 Jan 2016 12:00 AM
actually there are a couple issues now that i look at it, but those r cuz i got lazy and didnt completely finish the lexer (the most boring ass thing in the world to make)
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
10 Jan 2016 12:01 AM
yeah, the lexer is just frustrating

fixing one issue usually messes up like 3 different niche situations, it's infuriating
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
10 Jan 2016 12:05 AM
yeah lol

to match things like + - * / ( etc im using the %p pattern, and that was matching double quotes, which is what screwed up the string

and i also forgot to include true and false so they were matching as identifiers
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
10 Jan 2016 12:06 AM
if anyone cares here it is fixed:

typeof = ROOT
block = {
{
typeof = IF
block = {
{
typeof = IF
block = {
}
condition = {
{
typeof = IDENTIFIER
word = x
}
{
typeof = EQUAL_TO
}
{
typeof = TRUE
}
}
}
{
typeof = IF
block = {
}
condition = {
{
typeof = IDENTIFIER
word = y
}
{
typeof = EQUAL_TO
}
{
typeof = STRING
word = Hello!
}
}
}
}
condition = {
{
typeof = NUMBER
word = 10
}
{
typeof = MULTIPLY
}
{
typeof = NUMBER
word = 10
}
{
typeof = GREATER_THAN
}
{
typeof = NUMBER
word = 20
}
}
}
}
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
10 Jan 2016 12:48 AM
wtf
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
10 Jan 2016 01:30 AM
implemented defining variables :D

i implemented defining variables:

int x = 50;
y := "Hello, world!";
string z = y;


parses to



typeof = ROOT
block = {
{
typeof = ASSIGNMENT
expression = {
{
typeof = IDENTIFIER
word = x
}
{
typeof = ASSIGNMENT_WITH_DATATYPE
}
{
typeof = NUMBER
word = 50
}
}
identifier = x
datatype = int
}
{
typeof = ASSIGNMENT
expression = {
{
typeof = IDENTIFIER
word = y
}
{
typeof = ASSIGNMENT_WITHOUT_DATATYPE
}
{
typeof = STRING
word = Hello, world!
}
}
identifier = y
datatype = UNKNOWN
}
{
typeof = ASSIGNMENT
expression = {
{
typeof = IDENTIFIER
word = z
}
{
typeof = ASSIGNMENT_WITH_DATATYPE
}
{
typeof = IDENTIFIER
word = y
}
}
identifier = z
datatype = string
}
}
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
10 Jan 2016 01:33 AM
oops, the < identifier > < assignment_with/without_datatype > shouldn't be in there under the expression table :L
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
10 Jan 2016 02:17 AM
1. twitter
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
10 Jan 2016 02:20 AM
shh this is my twitter

and also this factorial function properly parsed :D:D:D:D:D:D

int factorial := (int n) {
if (n == 1) {
return 1;
}
return n * factorial(n - 1);
}



typeof = ROOT
block = {
{
typeof = FUNCTION
num_args = 1
identifier = factorial
block = {
{
typeof = IF
condition = {
{
typeof = IDENTIFIER
word = n
}
{
typeof = EQUAL_TO
}
{
typeof = NUMBER
word = 1
}
}
block = {
{
typeof = RETURN
expression = {
{
typeof = NUMBER
word = 1
}
}
}
}
}
{
typeof = RETURN
expression = {
{
typeof = IDENTIFIER
word = n
}
{
typeof = MULTIPLY
}
{
typeof = IDENTIFIER
word = factorial
}
{
typeof = OPEN_PARENTHESIS
}
{
typeof = IDENTIFIER
word = n
}
{
typeof = MINUS
}
{
typeof = NUMBER
word = 1
}
{
typeof = CLOSE_PARENTHESIS
}
}
}
}
arguments = {
{
datatype = int
identifier = n
}
}
}
}

















ok im done now
Report Abuse
bosswalrus is not online. bosswalrus
Joined: 04 Jan 2013
Total Posts: 5430
10 Jan 2016 02:27 AM
same
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image