Calling process without any defined process behaviour makes modes/mcsta crash
Calling a process without any defined process behaviour makes modes/mcsta crash. Fortunatly, at the moment we do get an error message giving the user a hint as to where he has maken a mistake before the crash.
The code example:
process A()
{
}
A(0)
The output & error:
(00:00) 0.
Parsing empty_process.modest...
empty_process.modest:(1,9): error: Process behaviour missing for process "A".
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Modest.Language.DummySymbolDictionary.ForProcess(ProcessSymbol process)
at Modest.Language.ModestParser.DummySymbolInstantiator.ForProcess(ProcessSymbol process)
at Modest.Language.ProcessSymbol.TransformDeclarations(ProcessSymbol tEnclosingProcess, ITransformer transformer, ComponentErrorHandler ceh)
at Modest.Language.ProcessSymbol.Transform(ITransformer transformer, ComponentErrorHandler ceh, ProcessSymbol tEnclosingProcess)
at Modest.Language.ModestParser.ParseModel(ModestLexer lexer, ComponentErrorHandler reportError)
at Modest.Language.ModestDocument.DoParse(String text, OperationState operationState, IErrorHandler errors)
at Modest.Language.ModestDocument.Parse(OperationState operationState, IErrorHandler errors)
at Modest.Modularity.InputToolchain`1.DoLoad(IP inputParameters, IDocument document, OperationState operationState, IErrorHandler errors)
at Modest.Modularity.InputToolchain`1.Load(IParameterObject inputParameters, IEnumerable`1 streams, IEnumerable`1 fileNames, OperationState operationState, IErrorHandler errors)
at Modest.Executables.Mcsta.Program.<>c__DisplayClass4_1.<Run>b__3(Stream[] streams)
at Modest.CommandLine.CommandLineHelper.UsingInputStreams(String[] inputFiles, Action`1 action)
at Modest.Executables.Mcsta.Program.Run(McstaParams parameters, Stopwatch time)
at Modest.Executables.Mcsta.Program.Main(String[] args)