Skip to content

Commit

Permalink
Add Parser 3 and nesC (pool)
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Apr 14, 2017
1 parent 643e30a commit c2f32b9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/code-gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ class Pascal < CodeGen
Code = %q("#$D(output);begin write(#{f(PREV,1){"'#$s',"}}'')end.")
end

class Parser3 < CodeGen
Disabled = true
Name = "Parser 3"
File = "QR.p"
Cmd = "parser3 QR.p > OUTFILE"
Apt = "parser3-cgi"
Code = %q("$console:line[#{PREV.gsub(/[:;()]/){?^+$&}}]")
end

class PARIGP < CodeGen
Name = "PARI/GP"
File = "QR.gp"
Expand Down Expand Up @@ -274,6 +283,27 @@ class Nickle < CodeGen
Code = %q("printf#{E[PREV]}")
end

class NesC < CodeGen
Disabled = true
Name = "nesC"
File = "QR.nc"
Cmd = "nescc -o QR QR.nc && ./QR > OUTFILE"
Apt = "nescc"
def code
<<-'END'.lines.map {|l| l.strip }.join
%(
#include<stdio.h>\n
module QR{}implementation{
int main()__attribute__((C,spontaneous)){
puts#{E[PREV+N]};
return 0;
}
}
)
END
end
end

class Neko < CodeGen
File = "QR.neko"
Cmd = "nekoc QR.neko && neko QR.n > OUTFILE"
Expand Down

0 comments on commit c2f32b9

Please sign in to comment.