Exemple #1
0
		protected void GenerateStatement (CodeStatement s)
		{
			if (s.StartDirectives.Count > 0)
				GenerateDirectives (s.StartDirectives);
			if (s.LinePragma != null)
				GenerateLinePragmaStart (s.LinePragma);

			CodeSnippetStatement snippet = s as CodeSnippetStatement;
			if (snippet != null) {
				int indent = Indent;
				try {
					Indent = 0;
					GenerateSnippetStatement (snippet);
				} finally {
					Indent = indent;
				}
			} else {
				try {
					s.Accept (visitor);
				} catch (NotImplementedException) {
					throw new ArgumentException ("Element type " + s.GetType () + " is not supported.", "s");
				}
			}

			if (s.LinePragma != null)
				GenerateLinePragmaEnd (s.LinePragma);

			if (s.EndDirectives.Count > 0)
				GenerateDirectives (s.EndDirectives);
		}