| /******************************************************************************* |
| * Copyright (c) 2014 1C LLC. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Vladimir Piskarev (1C) - initial API and implementation |
| *******************************************************************************/ |
| grammar org.eclipse.handly.examples.basic.Foo |
| with org.eclipse.xtext.common.Terminals |
| |
| generate foo "http://www.eclipse.org/handly/examples/basic/Foo" |
| |
| Module: |
| vars += Var* |
| defs += Def* |
| ; |
| |
| Var: |
| 'var' name=ID ';' |
| ; |
| |
| Def: |
| 'def' name=ID '(' (params+=ID)? (',' params+=ID)* ')' '{' '}' |
| ; |