Esempio n. 1
0
        internal void ResolveModes(NvdlCompileContext ctx, SimpleMode current)
        {
            if (source.UseMode != null)
            {
                mode = ctx.GetCompiledMode(source.UseMode);
            }
            else if (source.NestedMode != null)
            {
                mode = ctx.GetCompiledMode(source);
            }
            else
            {
                mode = current;
            }

            for (int i = 0; i < contexts.Length; i++)
            {
                contexts [i].ResolveModes(ctx, mode);
            }

            // FIXME: get location by some way
            if (mode == null)
            {
                throw new NvdlCompileException(
                          "mode does not contain either referenced modeUsage or nested mode.", null);
            }
        }
Esempio n. 2
0
        internal void ResolveModes(NvdlCompileContext ctx, SimpleMode current)
        {
            if (useModeName != null)
            {
                useMode = ctx.GetCompiledMode(useModeName);
            }
            else if (source.NestedMode != null)
            {
                useMode = ctx.GetCompiledMode(source);
            }
            else
            {
                useMode = current;
            }

            if (useMode == null)
            {
                throw new NvdlCompileException(String.Format("Specified mode '{0}' was not found.",
                                                             useModeName), this);
            }
        }
Esempio n. 3
0
        private void SimplifyModeUsage(
            NvdlNoCancelAction nca, NvdlCompileContext ctx)
        {
            NvdlModeUsage usage = nca.ModeUsage;

            if (usage.NestedMode != null && ctx.GetCompiledMode(usage) == null)
            {
                SimpleMode sm = new SimpleMode(String.Empty,
                                               usage.NestedMode, ctx);
                ctx.AddCompiledMode(usage, sm);
            }
            foreach (NvdlContext c in usage.Contexts)
            {
                if (c.NestedMode != null)
                {
                    SimpleMode sm = new SimpleMode(
                        String.Empty, c.NestedMode, ctx);
                    ctx.AddCompiledMode(c, sm);
                }
            }
        }
Esempio n. 4
0
		internal void ResolveModes (NvdlCompileContext ctx, SimpleMode current)
		{
			if (useModeName != null)
				useMode = ctx.GetCompiledMode (useModeName);
			else if (source.NestedMode != null)
				useMode = ctx.GetCompiledMode (source);
			else
				useMode = current;

			if (useMode == null)
				throw new NvdlCompileException (String.Format ("Specified mode '{0}' was not found.",
					useModeName), this);
		}
Esempio n. 5
0
		internal void ResolveModes (NvdlCompileContext ctx, SimpleMode current)
		{
			if (source.UseMode != null) {
				mode = ctx.GetCompiledMode (source.UseMode);
			}
			else if (source.NestedMode != null)
				mode = ctx.GetCompiledMode (source);
			else
				mode = current;

			for (int i = 0; i < contexts.Length; i++)
				contexts [i].ResolveModes (ctx, mode);

			// FIXME: get location by some way
			if (mode == null)
				throw new NvdlCompileException (
					"mode does not contain either referenced modeUsage or nested mode.", null);
		}
Esempio n. 6
0
		private void SimplifyModeUsage (
			NvdlNoCancelAction nca, NvdlCompileContext ctx)
		{
			NvdlModeUsage usage = nca.ModeUsage;
			if (usage.NestedMode != null && ctx.GetCompiledMode (usage) == null) {
				SimpleMode sm = new SimpleMode (String.Empty,
					usage.NestedMode, ctx);
				ctx.AddCompiledMode (usage, sm);
			}
			foreach (NvdlContext c in usage.Contexts) {
				if (c.NestedMode != null) {
					SimpleMode sm = new SimpleMode (
						String.Empty, c.NestedMode, ctx);
					ctx.AddCompiledMode (c, sm);
				}
			}
		}