symphonytool / symphony

The Symphony IDE
5 stars 4 forks source link

Null errors given on model #209

Closed joey-coleman closed 10 years ago

joey-coleman commented 10 years ago

The tool just returns the error "null." and stops parsing on the below model if the "DEEP" actions are uncommented.

types
  Meter :: device : Device

class Device = begin
operations
  public op : () ==> ()
  op() == Skip
end

process SmartGrid = begin
state
  meters : map nat to Meter := {|->}

actions
  OK_OBJ =
    (dcl m : Meter @
      m.device.op())

  OK_MAP =
    (dcl m_map : map nat to Meter @
        (dcl dev : Device @
            dev := m_map(1).device;
            dev.op()))

  DEEP_MAP =
    (dcl m_map : map nat to Meter @
        meters(1).device.op())

  OK_SEQ =
    (dcl ms : seq of Meter @
        (dcl m : Meter @
            m := ms(1);
            m.device.op()))

  DEEP_SEQ =
    (dcl ms : seq of Meter @
        ms(1).device.op())

@ Skip
end
joey-coleman commented 10 years ago

I'm initially giving this to Kenneth, though it may be a parser problem.

lausdahl commented 10 years ago

Cml.g line 1324 is where the parser gets stuck.

joey-coleman commented 10 years ago

I've updated the example in the original post; it also exists at core/parser/src/test/resources/issues/issue-209.cml.

The parser fix reads arbitrarily complex leading expressions that lead to an operation call (in case you have operations in objects that are fields of records in a mapping in a state variable of an object in a tuple... etc).

joey-coleman commented 10 years ago

Still not quite building the right ast for the TC