# VISIBLE , ! IF 5 < 10 VISIBLE 5 10
NULL -- writeline(string); write(string); readline[type](variable); F -- ->read(string); ->show(); ->delete(string); ->create(string);
# F, -> f->create(C:\15.txt); # , writeline(%c !);
using System; using System.IO; namespace lang { class MainClass { public static void Main (string[] args) { try { using (StreamReader sr = new StreamReader(args[0])) // { string line; // while ((line = sr.ReadLine()) != null) // { Parse.PARSE(line); // } } } catch (Exception ex) // catch { Console.Write(" : "); Console.WriteLine(ex.Message); } } } }
using System; namespace lang { public class Parse { public Parse () { } public static void PARSE(string code) { if (code.IndexOf ('#') != 0) { if(code.EndsWith(";")) { int a = code.IndexOf('('); int b = code.IndexOf(')'); string func = code.Substring(0,a); string args = code.Substring(a+1,ba-1); string[] arg = args.Split(','); func = func.Replace(" ", ""); switch(func.ToLower()) {
public static void PARSE(string code)
- This is our method for parsing stringsif (code.IndexOf ('#') != 0) {
- If the code does not begin with '#' (This is our comment), then parsim.if(code.EndsWith(";")) {
- Continue to parse if the string ends in a ';' function(arg1,arg2); ^ ^ ab
string func = code.Substring(0,a);
- we start clipping with 0 character to the first '(', as a result we get functionstring args = code.Substring(a+1,ba-1);
- we get the arguments started from the first character coming after '(' to ");" (+1)string[] arg = args.Split(',');
- create an array with arguments separated by ','func = func.Replace(" ", "");
- do this in order to avoid an error with a space. switch(func.ToLower()) { case "write": funct.write(arg); break; case "writeline": funct.writeline(arg); break; case "readline": funct.readln(arg[0]); break; }
public static string a; public static char b; public static int c;
using System; namespace lang { public class funct { public static string a; public static char b; public static int c; public static void writeline (string[] args) { int z = 0; string s = ""; if(args[z] == "a") { // writeline(a); a Console.WriteLine(a); } else if(args[z] == "b") { // writeline(b); b Console.WriteLine(b); } else if(args[z] == "c") { // writeline(c); c Console.WriteLine(c); } else { while(z < args.Length) { // s += args[z] + " "; z++; } s = s.Replace("%n", Environment.NewLine); // %n s = s.Replace("%c", ","); // %c Console.WriteLine(s); // } } public static void write (string[] args) // writeline { int z = 0; string s = ""; if(args[z] == "a") { Console.WriteLine(a); } else if(args[z] == "b") { Console.WriteLine(b); } else if(args[z] == "c") { Console.WriteLine(c); } else { while(z < args.Length) { s += args[z] + " "; z++; } s = s.Replace("%n", Environment.NewLine); s = s.Replace("%c", ","); Console.Write(s); } } public static void readln (string args) { if(args == "a") { // == a, a a = Console.ReadLine(); } else if(args == "b") { //, , Console.WriteLine("You can't use \"b\" variable as @STRING."); } else if(args == "c") { // Console.WriteLine("You can't use \"c\" variable as @STRING."); } } } }
Source: https://habr.com/ru/post/179529/
All Articles