Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional logging to this project #303

Open
nkchuykin opened this issue Aug 14, 2022 · 2 comments
Open

Add optional logging to this project #303

nkchuykin opened this issue Aug 14, 2022 · 2 comments
Assignees

Comments

@nkchuykin
Copy link
Collaborator

код на C:

int f(int x) {
  return x + 42;
}

так в ЕО:

[x] > f
  c2eo > @
    "/usr/local/src/foo.c"
    "122-125"
    plus.
      c2eo
        "/usr/local/src/foo.c"
        "123"
        x
      42
[file lines x] > c2eo
  x > @
@nkchuykin nkchuykin self-assigned this Aug 14, 2022
@nkchuykin
Copy link
Collaborator Author

blocked by #347

@nkchuykin
Copy link
Collaborator Author

nkchuykin commented Sep 5, 2022

So, for this example codes looks like:

+alias org.eolang.goto
+alias c2eo.coperators.meta
+alias c2eo.coperators.plus
+alias c2eo.coperators.ram
+alias c2eo.coperators.read-as-int32
+alias c2eo.coperators.write-as-int32

+package c2eo.src.test
[args...] > global
  $ > root
  ram > global-ram
    8192
  memory > empty-global-position
  ram > return-ram
    8192
  memory > return-mem_size
  address > return
    return-ram
    0
  [param-start param-size] > f-f
    plus > local-start
      param-start
      param-size
    plus > empty-local-position
      local-start
      0
    address > p-x
      global-ram
      plus
        param-start
        0
    goto > @
      [goto-return-label]
        seq > @
          meta
            "test.c"
            "2"
            write-as-int32
              return
              meta
                "test.c"
                "2"
                plus
                  meta
                    "test.c"
                    "2"
                    read-as-int32
                      meta
                        "test.c"
                        "2"
                        p-x
                  meta
                    "test.c"
                    "2"
                    42
            goto-return-label.forward TRUE
          TRUE
  seq > @
    TRUE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant