Feeling inclusive?

I’ve just started looking into including LMS files from other LMS files and there doesn’t seem to be a pre processor directive in the assembler that does it. I’m not very experienced with logo but from what I can tell the assembler is made up of three passes blllurb.

  • pass 0: process definitions
  • pass 1: fill in opcode, etc
  • pass 2: process labels
  • (copied from assembler.logo)

    Considering how the C pre processors handle the include directive I looked into pass 0. It seems to be four things that the assembler looks for in pass 0.

  • vmthread
  • subcall
  • define
  • label
  • So there doesn’t seem to be an include directive for LMS. I’ve quickly looked through the other passes but none of them seemed to do anything like it.

    After that setback I remembered that I had found a file called template.lms. It was used by a LMS called Brick Program.lms, so I opened that one up and looked into it. Template.lms seems to include template code for the programming blocks you use when you use the Block Programmer on the EV3 Brick, so to the best of my knowledge it seems like the Block Program is the UI for programming the EV3 Brick on the brick, and it use the template.lms to include code snippets that in the end will make up the code that the user generated through the flow chart.

    Then I remembered the LOAD_IMAGE function, that loads byte code for execution. But LOAD_IMAGE doesn’t seem to allow execution of selected functions in the loaded file, only executing the full file.

    So for now there doesn’t seem to be a way to reuse LMS code in different projects. But since that is a matter of a simple text processing directive then perhaps I’ll look into writing my own pre processor that manages it. I’ll add it to my to do list. 🙂

    Leave a Reply