Skip to content

HttoHu/Merdog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  Merdog

Merdog is a mini C-Like interpreter

Other languages

Grammar

  1. basic types int, real, string, bool,char
  2. allocate heap objects by key word new based on the std::shared_ptr
  3. basic control statement if / else / elif / while / do while / for / switch
  4. support the declaration and defination of a function
  5. support defining struct, and member function
  6. support array and vector, deque, map,set
  7. some basic and useful functions

Example

using vector;
function int sum (int x, int y)
{
    return x+y;
}
program main
{
    // create 2 ints and init with 0
    vector<int> vec(2,0);
    vec[0]=std.input_int();
    vec[1]=std.input_int();
    // it can be replaced by operator +
    std.cout(sum(vec[0],vec[1]));
}

About

License

Copyright (c) HttoHu. All rights reserved.

Licensed under the MIT license.