[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

parsing shit right now... i'm sure i can simplify this

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 32
Thread images: 2

parsing shit right now... i'm sure i can simplify this

i am checking for combination types
>>
>>61539179
This is disgusting
>>
>>61539179
Looks like java, just use javacc if you want a parser.
>>
What exactly is this being used for?
>>
>>61539238
It's not java you stupid pajeet. It's javascript and that guy is dumb.
>>
>>>/dpt/
>>
>>61539269
Oh wait I forgot we can do this.
>>>/g/dpt
>>
>>61539238
Just noticed the var, search for a javascript parser compiler if you care to make it clean.
Or just look up how to make parsers directly, not that you should.
>>
>>61539287
You're doing it wrong
>>>/g/wdg
>>
>>61539302
zuz
>>
>>61539179
It's quite easy to generate a parser using Coco/R. It supports Java, so it might be something you'd want to look at.
>>
>>61539179

regex
>>
>>61539179
use comments motherfucker
>>
>>61539395
I'm literally almost done.
after this step i'm doing all I have to do is work on the transpiler.
I think i can simplify that switch case structure by passing a particular object structure into a function.

I just created pic related.I should be able to use that.
_ is the type
__ is what can follow
$ is the function it will use to handle of the type-combo stops there....

"stops there" so that means we gotta check all the possible things that can come after and see if they're available. so this all takes place inside of an <element>

I can keep going and actually get to some code

var hit = false;
__.forEach(function(potential){
if( theNextElementsType == potential._ ){
hit = true;
}
});
>>
>>61540554
Go back to India, Rajesh.
>>
>>61540596
why? because I actually code?
>>
>>61539179
you could put everything for r[i+1] and everything for r[i+2] in separate functions. That would make it more readable probably
>>
Install Common Lisp
>>
>>61540605
Jesus Christ dude, your """code""" is shit. The syntax is vomit inducing.
>>
You have the dpt to show of your *code*
>>
>>61541447
>someone shows their work
>call them a non-white slur.
>profit

seriously. go kill yourself.
>>
>>61541476
>calling someone by a common name and pointing out their suspected region of origin is a slur
wat
does everything have to be race and offensive to you people?
>>
OP, most of /g/ doesn't know how to code, and those who do aren't nearly as good as they think they are. they like to pretend like they "know better" but when it comes to actually showing their knowledge, they are silent. why? because they can't do any better. they just like to shit on you and call you "rajeesh" or "poojeet" because they lost their job to an indian coder, and they can't deal with the fact that a non-white is better than them at something.

your code is fine. and even if it's not optimal, maintainability and readability is 100x more important than performance in 99% of cases. and that last 1% is problems that are worked on by people way smarter than sperging autists here, jerking off over their unreadable codegolf-tier c++ solutions on a laotian hedge-trimming image board
>>
>>61539179
Y A C C
A
C
C

L E X
E
X
>>
>>61541729
This is definitely optimized more toward performance than maintainability and readability.
>>
>>61541628
BTW I'm black.
I'm not gonna discuss this any more. Sam Harris openly said Africa needs more colonialism. Seriously not fucking around with that type of shit.
>>
Create a BNF-type grammar and just use Jison
>>
>>61542764
He is right nigger
>>
>triple-nested switch/case
what the fuck are you trying to do
>>
>>61541729
>maintainability and readability is 100x more important
Yes, which is why he should consider rewriting this.
>>
>>61542764
>BTW I'm black.
Does everything have to be race with you people?
>>
>>61541731
this tbqh familia
Thread posts: 32
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.