text stringlengths 10 2.72M |
|---|
package com.giraldo.parqueo.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.giraldo.parqueo.model.Propietario;
@Repository
public interface PropietarioRepository extends JpaRepository<Propietario, Long>{
//**************************************************************************************lo hice
List<Propietario> findByNumeroDocumento(long numeroDocumento);
//**************************************************************************************
}
|
/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.text.NumberFormat;
/**
* This app displays an order form to order coffee.
*/
public class MainActivity extends AppCompatActivity {
private int numOfCoffees=0;
private final int priceOfOneCupOfCoffee = 5;
private final int priceOfWhippedCreamPerCup = 2;
private final int priceOfChocolatePerCup = 1;
private boolean whippedCream = false;
private boolean chocolateTopping = false;
private String nameStr = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
/**
* This method is called when the order button is clicked.
*/
public void submitOrder(View view) {
this.nameStr = getName();
displayQuantity(this.numOfCoffees);
this.getToppings();
int price = calculatePrice();
String orderSummary = createOrderSummary(price);
//displayOrderSummary(orderSummary);
emailOrderSummary(orderSummary);
}
/**
* This method is called when the - button is pressed.
*/
public void decrementQuantity(View view) {
if (this.numOfCoffees<=1) {
Toast.makeText(this, getString(R.string.toast_qty_too_small), Toast.LENGTH_SHORT).show();
return;
}
this.numOfCoffees--;
displayQuantity(this.numOfCoffees);
}
/**
* This method is called when the + button is pressed.
*/
public void incrementQuantity(View view) {
if (this.numOfCoffees>=10) {
Toast.makeText(this, getString(R.string.toast_qty_too_big), Toast.LENGTH_SHORT).show();
return;
}
this.numOfCoffees++;
displayQuantity(this.numOfCoffees);
}
/**
* This method displays the given quantity value on the screen.
*/
private void displayQuantity(int number) {
TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
/**
* This method gets the toppings from the checkboxes.
*/
private void getToppings() {
CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_check_box);
this.whippedCream = whippedCreamCheckBox.isChecked();
CheckBox chocolateCheckBox = (CheckBox) findViewById(R.id.chocolate_check_box);
this.chocolateTopping = chocolateCheckBox.isChecked();
}
/**
* This method gets the name of customer from the edit text.
*/
private String getName() {
EditText nameEditText = (EditText) findViewById(R.id.name_edit_text);
return nameEditText.getText().toString();
}
/**
* This method displays the order summary on the screen.
*/
private void displayOrderSummary(String orderSummary) {
TextView orderSummaryTextView = (TextView) findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(orderSummary);
}
/**
* This method emails the order summary.
*/
private void emailOrderSummary(String orderSummary) {
displayOrderSummary(orderSummary);
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:")); // only email apps should handle this
intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name)+getString(R.string.email_subj_snippet)+this.nameStr);
intent.putExtra(Intent.EXTRA_TEXT, orderSummary);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
/**
* Calculates the price of the order based on the current quantity.
*
* @return the price
*/
private int calculatePrice() {
return this.numOfCoffees *
(this.priceOfOneCupOfCoffee +
(this.whippedCream?this.priceOfWhippedCreamPerCup:0) +
(this.chocolateTopping?this.priceOfChocolatePerCup:0));
}
/**
* This method creates an order summary to be displayed on screen
*
* @param price this is the price that was calculated
*
* @return String Order Summary String
*/
private String createOrderSummary(int price) {
String ordersummary = "";
ordersummary += getString(R.string.order_status_name_label) + getString(R.string.order_status_label_value_delimiter) + this.nameStr + "\n";
ordersummary += getString(R.string.order_status_quantity_label) + getString(R.string.order_status_label_value_delimiter) + this.numOfCoffees + "\n";
if (this.whippedCream) {
ordersummary += getString(R.string.order_status_whipped_cream) + "\n";
}
if (this.chocolateTopping) {
ordersummary += getString(R.string.order_status_chocolate) + "\n";
}
ordersummary += getString(R.string.order_status_total) + getString(R.string.order_status_label_value_delimiter) + NumberFormat.getCurrencyInstance().format(price) + "\n";
ordersummary += getString(R.string.order_status_thank_you);
return ordersummary;
}
} |
package ist.es.refactorings;
import java.util.ArrayList;
import java.util.List;
public class ExtractMethodExample {
/**
* Orders issued by a given client, initialized somewhere
*/
private final List<Order> orders = new ArrayList<Order>();
/**
* @param outstanding
* @return
*/
private double computeDivida(double outstanding) {
// calculate outstanding
for (final Order o : orders) {
outstanding += o.getAmount();
}
return outstanding;
}
/**
* @param clientName
* @param outstanding
*/
private void imprimiteTotal(String clientName, double outstanding) {
//print debt and details
System.out.println("name:" + clientName);
System.out.println("amount" + outstanding);
}
/**
*
*/
private void printHeader() {
System.out.println("************************");
System.out.println("**** Customer Owes *****");
System.out.println("************************");
}
/**
* Prints the amount owned by a given client.
*
* @param clientName the client name
*/
void printOwing(String clientName) {
double outstanding = 0.0;
/*
* Try the "Extract Method" refactoring on Eclipse selecting a
* block of code and pressing
*/
// print banner
printHeader();
outstanding = computeDivida(outstanding);
imprimiteTotal(clientName, outstanding);
}
};
class Order {
final int amount;
final String orderName;
public Order(String orderName, int amount) {
this.orderName = orderName;
this.amount = amount;
}
public int getAmount() {
return amount;
}
}
|
package com.company;
import java.awt.*;
public class Castle implements Drawable {
private int x, y, width, height, width2, nPoints;
private int[] xPoints, yPoints;
private Color color;
public Castle(int x, int y, int width, int height, int width2, int[] xPoints,
int[] yPoints, int nPoints, Color color) {
this.x = x;
this.y = y;
this.width = width;
this.width2 = width2;
this.height = height;
this.xPoints = xPoints;
this.yPoints = yPoints;
this.nPoints = nPoints;
this.color = color;
}
@Override
public void draw(Graphics2D g) {
g.setColor(color);
g.fillRect(x, y, width, height);
int i = 1;
while (i <= width / (2 * width2)) {
g.fillRect(x - width2 * 2 + i * 10, y - width2 * 2, width2, width2 * 2);
i++;
}
g.fillRect(x + 80, y + 50, width + 20, height);
g.fillRect(x + 180, y - 50, width - 10, height + 200);
i = 1;
while (i <= (width - 10) / (2 * width2)) {
g.fillRect(x + 180 - width2 * 2 + i * 10, y - 50 - width2 * 2, width2, width2 * 2);
i++;
}
g.setStroke(new BasicStroke(5.0f));
g.drawLine(x + 215, y - 50, x + 215, y - 200);
Polygon polygon = new Polygon(xPoints, yPoints, nPoints);
g.setPaint(Color.red);
g.fillPolygon(polygon);
}
} |
public interface IMatrixModifiers {
public void matrixReplace(String matrix[][], String original, String novo); /* Substitui todas as ocorrencias de "original" da matriz por "novo" */
public void matrixClean(String matrix[][]); /* Retira linhas iguais da matrix */
public void deleteCollum(String matrix[][], int index); /* Deleta a coluna da matriz */
public void deleteLine(String matrix[][]); /* Deleta a linha da matriz */
}
|
// Sun Certified Java Programmer
// Chapter 6, P456_2
// Strings, I/O, Formatting, and Parsing
import java.io.*;
class Tester456_2 {
public static void main(String[] args) {
/*String[] files = new String[100];
File search = new File("searchThis");
files = search.list(); // create the list
for(String fn: files) // iterate through it
System.out.println("found " + fn);*/
// P457
System.console();
}
}
|
package com.jawspeak.unifier;
import static org.junit.Assert.assertEquals;
import java.util.Map;
import org.junit.Test;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
public class ClassPathDifferTest {
@Test
public void recognizeNoDifferecesInSameClassInfos() throws Exception {
Map<String,ClassInfo> map = ImmutableMap.of("com.jawspeak.MyClass", new ClassInfo("com.jawspeak.MyClass"));
ClassPathDiffer differ = new ClassPathDiffer(map, map);
assertEquals(Lists.newArrayList(), differ.changesNeededInBToMatchA());
assertEquals(Lists.newArrayList(), differ.changesNeededInAToMatchB());
}
@Test
public void classNamesDifferent() throws Exception {
Map<String,ClassInfo> mapA = ImmutableMap.of("com.jawspeak.MyClass", new ClassInfo("com.jawspeak.MyClass"));
Map<String,ClassInfo> mapB = ImmutableMap.of("com.jawspeak.MyClassV2", new ClassInfo("com.jawspeak.MyClassV2"));
ClassPathDiffer differ = new ClassPathDiffer(mapA, mapB);
assertEquals(Lists.newArrayList(new AddClassPathModification(new ClassInfo("com.jawspeak.MyClass"))), differ.changesNeededInBToMatchA());
assertEquals(Lists.newArrayList(new AddClassPathModification(new ClassInfo("com.jawspeak.MyClassV2"))), differ.changesNeededInAToMatchB());
}
}
|
package javabasico.aula27labs;
/**
* @author Kim Tsunoda
* Objetivo Escreva uma classe para representar uma lâmpada. Desenvolva métodos para ligar, desligar a lampada.
*/
public class Exercicio01 {
public static void main (String []args) {
Lampada lampada = new Lampada ();
lampada.ligar();
lampada.mostrarEstado();
lampada.desligar();
lampada.mostrarEstado();
}
}
|
package com.tencent.mm.g.a;
import com.tencent.mm.sdk.b.b;
public final class nj extends b {
public a bYp;
public nj() {
this((byte) 0);
}
private nj(byte b) {
this.bYp = new a();
this.sFm = false;
this.bJX = null;
}
}
|
package pl.cwanix.opensun.agentserver.engine.experimental.maps;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public enum ZoneType {
VILLAGE(1);
private final int type;
public byte getType() {
return (byte) this.type;
}
public boolean equals(final int value) {
return type == value;
}
public boolean equals(final ZoneType value) {
return type == value.getType();
}
}
|
package ameca;
/**
*
* @author manu
*/
//import com.mysql.cj.util.StringUtils;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Locale;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
//import org.apache.http.client.utils.URIBuilder;
//import manu.utils.*;
public class Comercios extends HttpServlet
{
HTML htm=new HTML();
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{ doGet(request, response); }
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{ // htmls.logger.fine("homeOsoc. Carga servlet\n--");
if (!HTML.getIgnited_actividades())
HTML.Carga_actividades();
if (!HTML.getIgnited_zonas())
HTML.Carga_zonas();
if (!HTML.getIgnited_localidades())
HTML.Carga_localidades();
if (!HTML.getIgnited_condiciones_iva())
HTML.Carga_condiciones_iva();
if (!HTML.getIgnited_condiciones_iibb())
HTML.Carga_condiciones_iibb();
// if (!HTML.getIgnited_periodo()) periodo es el unico parametro que verifica estado de actualizacion en el metodo getPeriodo()
// HTML.Carga_periodo();
if (!HTML.getIgnited_categorias_autonomo())
HTML.Carga_categorias_autonomo();
if (!HTML.getIgnited_categorias_monotributo())
HTML.Carga_categorias_monotributo();
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String operacion = request.getParameter ("operacion") != null ? request.getParameter ("operacion") : "nuevo" ;
String periodo = request.getParameter ("periodo") != null ? request.getParameter ("periodo") : htm.getPeriodo_nostatic() ;
String nro_cuit = request.getParameter ("nro_cuit") != null ? request.getParameter ("nro_cuit") : "--" ;
if (nro_cuit.equals(""))
nro_cuit="--";
String nro_cuit_admin = request.getParameter ("nro_cuit_admin") != null ? request.getParameter ("nro_cuit_admin") : "" ;
String razon_social = request.getParameter ("razon_social") != null ? request.getParameter ("razon_social") : "" ;
String codigo_postal = request.getParameter ("codigo_postal") != null ? request.getParameter ("codigo_postal") : "" ;
String nombre_responsable = request.getParameter ("nombre_responsable") != null ? request.getParameter ("nombre_responsable") : "" ;
String observaciones = request.getParameter ("observaciones") != null ? request.getParameter ("observaciones") : "" ;
String id_zona = request.getParameter ("id_zona") != null ? request.getParameter ("id_zona") : "0" ;
String id_localidad = request.getParameter ("id_localidad") != null ? request.getParameter ("id_localidad") : "" ;
String nro_telefono = request.getParameter ("nro_telefono") != null ? request.getParameter ("nro_telefono") : "" ;
String nro_telefono2 = request.getParameter ("nro_telefono2") != null ? request.getParameter ("nro_telefono2") : "" ;
String email = request.getParameter ("email") != null ? request.getParameter ("email") : "" ;
String periodo_alta = request.getParameter ("periodo_alta") != null ? request.getParameter ("periodo_alta") : "" ;
String periodo_baja = request.getParameter ("periodo_baja") != null ? request.getParameter ("periodo_baja") : "" ;
String id_comercio = request.getParameter ("id_comercio") != null ? request.getParameter ("id_comercio") : "0" ;
String domicilio_fiscal = request.getParameter ("domicilio_fiscal") != null ? request.getParameter ("domicilio_fiscal") : "" ;
String cuit_calle = request.getParameter ("cuit_calle") != null ? request.getParameter ("cuit_calle") : "" ;
String direccion_establecimiento = request.getParameter ("direccion_establecimiento") != null ? request.getParameter ("direccion_establecimiento") : "" ;
String condicion_iibb = request.getParameter ("condicion_iibb") != null ? request.getParameter ("condicion_iibb") : "" ;
String condicion_iva = request.getParameter ("condicion_iva") != null ? request.getParameter ("condicion_iva") : "" ;
String categ_monotributo = request.getParameter ("categ_monotributo") != null ? request.getParameter ("categ_monotributo") : "" ;
String categ_autonomo = request.getParameter ("categ_autonomo") != null ? request.getParameter ("categ_autonomo") : "" ;
String op2 = request.getParameter ("op2") != null ? request.getParameter ("op2") : "" ;
String imp_neto_g = request.getParameter ("imp_neto_g") != null ? request.getParameter ("imp_neto_g") : "" ;
String imp_neto_ng = request.getParameter ("imp_neto_ng") != null ? request.getParameter ("imp_neto_ng") : "" ;
String imp_op_ex = request.getParameter ("imp_op_ex") != null ? request.getParameter ("imp_op_ex") : "" ;
String imp_iva = request.getParameter ("imp_iva") != null ? request.getParameter ("imp_iva") : "" ;
String imp_tot = request.getParameter ("imp_tot") != null ? request.getParameter ("imp_tot") : "" ;
if(operacion.equals("find"))
{
out.println(HTML.getHead("comercios", htm.getPeriodo_nostatic()));
out.println("<br>\n<h1>Buscar Comercio</h1>"+
"\n<form action='/ameca/comercios' name='busca'>\n\t" +
"\n\t<table><tr><td>Ingrese CUIT del Comercio: </td><td><input type='text' name='nro_cuit'></td><td rowspan='2' valign='middle' align='center' width='90px'> <img src=\"/ameca/imgs/ok.png\" style=\"width:48px;height:48px;\" onclick=\"document.busca.submit();\" onmouseover=\"this.style.cursor='pointer'\">\n</td></tr>\n\t");
out.println("\n<tr><td>Ingrese Calle del Establecimiento: </td><td><input type='text' name='direccion_establecimiento'></td></tr></table>");
out.println("<input type='hidden' name='operacion' value='find'> "+
"\n</form><br><br><br>");
if (!cuit_calle.equals(""))
out.println(this.TablaFindComercios(cuit_calle));
else if(!nro_cuit.equals("--") || !direccion_establecimiento.equals(""))
out.println(this.TablaFindComercios(nro_cuit, direccion_establecimiento));
out.println("<table><tr><td height='377px'></td></tr></table>");
out.println(HTML.getTail());
}
else if (operacion.equals("new"))
{
out.println(HTML.getHead("comercios", htm.getPeriodo_nostatic())); //devuelve la mitad de la tabla con <tr>s hasta las catgegs del menu (inicio, comercios, liquidaciones, facturacion).
if (id_comercio.equals("0"))
out.println("<br><h2>Nuevo Comercio:</h2> <br>");
else
out.println("<br><h2>Editar Comercio:</h2> <br>");
out.println("\n<form action='/ameca/comercios' name='comercio' method='post'><table cellSpacing='0' cellPadding='0'>\n\t"+
"<tr>\n\t\t<td>CUIT: </td><td><input type='text' name='nro_cuit' value='"+nro_cuit+"'></td> <td>CUIT Admin.: </td><td><input type='text' name='nro_cuit_admin' value='"+nro_cuit_admin+"'></td></tr>\n\t"+
"<tr>\n\t\t<td>Razon Social: </td><td><input type='text' name='razon_social' value='"+razon_social+"'></td> <td></td><td></td></tr>\n\t"+
"<tr>\n\t\t<td>Nombre Responsable: </td><td><input type='text' name='nombre_responsable' value='"+nombre_responsable+"'></td> <td></td><td></td></tr>\n\t"+
"<tr>\n\t\t<td>Domicilio Fiscal: </td><td><input type='text' name='domicilio_fiscal' value='"+domicilio_fiscal+"'></td> <td>Código Postal: </td> <td><input type='text' name='codigo_postal' value='"+codigo_postal+"'></td></tr>\n\t"+
"<tr>\n\t\t<td>Localidad: </td><td>"+HTML.getDropLocalidades()+"</td>\t"+
"\t<td></td> <td></td></tr>\n\t"+
"<tr>\n\t\t<td>Telefono: </td><td><input type='text' name='nro_telefono' value='"+nro_telefono+"'></td> <td>Telefono2: </td> <td><input type='text' name='nro_telefono2' value='"+nro_telefono2+"'></td> </tr>\n\t"+
"<tr>\n\t\t<td>Email: </td><td><input type='email' name='email' value='"+email+"'></td><td></td><td></td></tr>");
if (id_comercio.equals("0"))
out.println("<tr>\n\t\t<td>Fecha de Alta: </td><td><input type='text' name='periodo_alta' disabled></td> <td>Fecha de Baja</td> <td><input type='text' name='periodo_baja' disabled></td></tr>");
else
{out.println("<tr>\n\t\t<td>Fecha de Alta: </td><td><input type='text' name='periodo_alta' value='"+periodo_alta+"' size='8'></td> <td>Fecha de Baja</td> <td><input type='text' name='periodo_baja' value='"+periodo_baja+"' disabled size='8'>");
if (periodo_baja.equals("-"))
out.println(" <a href='/ameca/comercios?operacion=ab&op2=baja&id_comercio="+id_comercio+"'> Dar de baja </a> </td></tr>");
else
out.println(" <a href='/ameca/comercios?operacion=ab&op2=alta&id_comercio="+id_comercio+"'> Dar de alta </a> </td></tr>");
out.println("\n <script> document.comercio.id_localidad.value='"+id_localidad+"'; \n </script>");
}
out.println("<tr>\n\t\t<td valign='top'>Observaciones: </td><td colspan='3'><textarea name='observaciones' cols='60' rows='6'>"+observaciones+"</textarea></td> </tr>");
out.println("</table><input type='hidden' name='operacion' value='save'> <input type='hidden' name='id_comercio' value='"+id_comercio+"'> </form>\n\n");
out.println("<table><tr><td height='30px'></td></tr></table>"); // aca va el contenido del cuerpo bajo, mas claro
if (id_comercio.equals("0"))
out.println("<table><tr><td><img src='/ameca/imgs/back.png'></td> ");
else
out.println("<table><tr><td><a href='/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"'><img src='/ameca/imgs/back.png'></a></td> ");
out.println("<td width='320px'></td>"
+ "<td><img src=\"/ameca/imgs/ok_big.png\" onclick=\"document.comercio.submit();\" onmouseover=\"this.style.cursor='pointer'\"></td></tr></table> <br><br>");
out.println(HTML.getTail());
}
else if (operacion.equals("save")) //guarda (insert o update) los datos recibidos del formulario del comercio ya completo
{
String res="";
if (id_comercio == null || !id_comercio.matches("-?\\d+(\\.\\d+)?"))
id_comercio="0";
out.println("<html><head><title>Ameca - Save Data</title>\n </head> \n <body> \n\n ");
/* out.println("charset: "+Charset.defaultCharset().displayName()+"<br> ");
out.println("locale: "+Locale.getDefault()+"<br> ");
out.println("nombre1: "+nombre_responsable+"<br> ");
out.println("nombre2 decode: "+URLDecoder.decode(nombre_responsable)+"<br> ");
out.println("nombre3 decode, ISO-8859-1: "+URLDecoder.decode(nombre_responsable, "ISO-8859-1")+"<br> ");
out.println("nombre4 decode, US-ASCII: "+URLDecoder.decode(nombre_responsable, "US-ASCII")+"<br> ");
out.println("nombre5 decode, UTF-8: "+URLDecoder.decode(nombre_responsable, "UTF-8")+"<br> ");
*/
if (id_comercio.equals("0"))
res=this.insertaComercio(nro_cuit, razon_social, nombre_responsable, domicilio_fiscal, id_localidad, nro_telefono, email, codigo_postal, nro_telefono2, observaciones, nro_cuit_admin);
else
res=this.updateComercio(id_comercio, nro_cuit, razon_social, nombre_responsable, domicilio_fiscal, id_localidad, nro_telefono, email, periodo_alta, nro_cuit_admin, codigo_postal, nro_telefono2, observaciones);
if (res != null && res.matches("-?\\d+(\\.\\d+)?"))
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+res+"\");} document.body.style.background='green'; \n window.setTimeout(go, 40); \n</script><br>");
else
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\");} \n document.body.style.background='red'; \n window.setTimeout(go, 9000); \n</script><br><br>Query: "+res);
out.println("</body></html>");
}
else if (operacion.equals("detalle"))
{
out.println(HTML.getHead("comercios", htm.getPeriodo_nostatic()));
out.println("<br><br><br>");
out.println("<table width='1820px' bgcolor='#E8E7C1' cellspacing='0'>\n\t"
+ "<tr><th bgcolor='#ccc793' width='5px'></th> <th align='left' colspan='3' bgcolor='#ccc793' width='1810px'> <table cellspacing='0'><tr><td><a href='/ameca/comercios?operacion=new'><img src='/ameca/imgs/cmrc_google48.png'></a></td><td width='10px'></td> <td style='height:64px; font-family:Arial; font-size:40px; font-weight: bold;'>Administrar Comercio</td></tr></table></th> <th bgcolor='#ccc793' width='5px'> </th></tr>"
+ "<tr><td colspan='5' height='15px'></td></tr>"
+ "<tr><td></td><td rowspan='2' valign='top' width='510px'>"+this.DatosComercioTable(id_comercio)+"</td> <td width='20px'></td> <td valign='top' align='left' width=1010'><table cellspacing='0'><tr><td style='height:56px; font-family:Arial; font-size:30px; font-weight: bold;'>Establecimientos</td> <td width='8px'></td><td><a href='/ameca/establecimientos?operacion=new&id_comercio=" + id_comercio + "&nro_cuit="+nro_cuit+"'> <img src='/ameca/imgs/sucu48.png'></a></td></tr></table></td><td></td>");
out.println("<tr><td></td><td></td>"
// + "<td valign='top'>"+this.getPerfilImpositivo(id_comercio)+"</td><td></td>"
+ "<td valign='top'>"+this.DatosEstablecimientoTable(id_comercio, nro_cuit)+"</td><td></td>\n\t</tr>\t\n\n");
out.println("<tr><td colspan='5' height='15px'></td></tr></table><br><br><br><br>");
out.println(HTML.getTail());
}
else if (operacion.equals("perfil"))
{
String categ=categ_monotributo.equals("0")?categ_autonomo:categ_monotributo;
out.println(HTML.getHead("comercios", htm.getPeriodo_nostatic()));
out.println("<br><h2>Editar Perfil Impositivo:</h2><br><br>"+
"\n\n<script>\n");
out.println(htm.getScriptCategsIVA());
out.println("\n\n</script>");
out.println("<form name='perfil' action='/ameca/comercios'>"
+ "<table width='1100px' bgcolor='#E8E7C1' cellspacing='0' border='0'>\n\t"
+ "<tr> <td style='width:250px;position:sticky;'> CUIT: </td> <td style='width:900px;position:sticky;'> "+nro_cuit+"</td> </tr> "
+ "<tr><td>NOMBRE: </td> <td>"+nombre_responsable+"</td></tr> "
+ "<tr><td>DOMICILIO FISCAL: </td> <td>"+domicilio_fiscal+"</td></tr>"
+ "<tr><td height='15px' colspan='2'></td></tr> "
+ "<tr><td>Condicion IIBB: </td><td align='left'>"+HTML.getForm_iibb()+"</td> </tr>"
+ "<tr><td>Condicion IVA: </td><td align='left'>"+HTML.getForm_iva()+"</td> </tr>"
+ "<tr><td>Categoria IVA: </td><td align='left'><select name='categ'></select></td> </tr>");
out.println( "<tr><td height='35px' colspan='2'><input type='hidden' name='id_comercio' value='"+id_comercio+"'> <input type='hidden' name='operacion' value='save_perfil'> <input type='hidden' name='categ_autonomo'> <input type='hidden' name='categ_monotributo'> </td></tr> ");
out.println("<tr><td colspan='2'> <table width='650px'> <tr> <td><a href='/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"'><img src='/ameca/imgs/back.png'></a></td> "
+ "<td width='160px'></td>"
+ "<td><img src=\"/ameca/imgs/ok_big.png\" onclick=\"if(document.perfil.condicion_iva.value==1) {document.perfil.categ_autonomo.value=0; document.perfil.categ_monotributo.value=document.perfil.categ.value; } else {document.perfil.categ_autonomo.value=document.perfil.categ.value; document.perfil.categ_monotributo.value=0; } document.perfil.submit();\" onmouseover=\"this.style.cursor='pointer'\"></td></tr></table> </td> </tr> </table><br><br>");
// out.println("<a href='/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"'><img src='/ameca/imgs/back.png'></a> <br>");
out.println("\n </form> \n <script>"
+ "document.perfil.condicion_iibb.value='"+condicion_iibb+"'; "
+ "document.perfil.condicion_iva.value='"+condicion_iva+"';"
+ "make("+condicion_iva+", "+categ+");"
+ "</script><br><br><br>");
out.println(HTML.getTail());
}
else if (operacion.equals("save_perfil")) //guarda los datos recibidos del formulario ya completo
{
out.println("<html><head><title>Ameca - Save Data</title>\n\n</head>" +
"<body> \n\n "+
"\nValores recibidos del formulario: <br>"+
"\n<table cellSpacing='0' cellPadding='0'>\n\t"+
"<tr>\n\t\t<td>CUIT: "+nro_cuit+"</td></tr>"+
"<tr>\n\t\t<td>Condicion iibb: "+condicion_iibb+"</td></tr>"+
"\n\t<tr>\n\t\t<td>Condicion iva: "+condicion_iva+"</td></tr>"+
"\n\t<tr>\n\t\t<td>Categoria autonomo: "+categ_autonomo+"</td></tr>"+
"\n\t<tr>\n\t\t<td>Categoria monotributo: "+categ_monotributo+"</td></tr>"+
"</table>");
String res=this.updateComercio_perfil (id_comercio, condicion_iibb, condicion_iva, categ_autonomo, categ_monotributo);
//out.println("<br><br>Insert: "+res);
if (res != null && res.matches("-?\\d+(\\.\\d+)?"))
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\");} \n document.body.style.background='green'; window.setTimeout(go, 100); \n</script>\n</body>\n</html>");
else
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\");} \n document.body.style.background='red'; window.setTimeout(go, 9000); \n</script><br><br>query: "+res+"\n\n</body>\n</html>");
//out.println("<script>function go() {window.location.href=\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\";} \n window.setTimeout(go, 9000); \n</script>");
//out.println("<a href='/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"'>Volver</a> <br><br>");
}
else if (operacion.equals("compras")) // ultimo requerimiento
{
out.println(HTML.getHead("comercios", htm.getPeriodo_nostatic()));
out.println("<br><h2>Resumen de Compras:</h2><br><br>");
if (op2.equals("insert"))
{ //out.println("pre update: false, "+periodo+", "+id_comercio+", "+imp_neto_g+", "+imp_neto_ng+", "+imp_op_ex+", "+imp_iva+", "+imp_tot);
out.println (this.updateResumenCompras (false, periodo, id_comercio, imp_neto_g, imp_neto_ng, imp_op_ex, imp_iva, imp_tot));
//out.println("post update ");
}
if (op2.equals("update"))
out.println (this.updateResumenCompras (true, periodo, id_comercio, imp_neto_g, imp_neto_ng, imp_op_ex, imp_iva, imp_tot));
out.println(this.ResumenCompras(id_comercio, nro_cuit, nombre_responsable, periodo));
out.println("<br><br><br><br><br><br><br><br>");
out.println(HTML.getTail());
/*
if (res != null && res.matches("-?\\d+(\\.\\d+)?"))
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\");} \n document.body.style.background='green'; window.setTimeout(go, 100); \n</script>\n</body>\n</html>");
else
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\");} \n document.body.style.background='red'; window.setTimeout(go, 9000); \n</script><br><br>query: "+res+"\n\n</body>\n</html>");
*/
}
else if (operacion.equals("ab")) //guarda los datos recibidos del formulario ya completo
{
String res="";
out.println("<html><head><title>Ameca - Save Data</title>\n\n</head>" +
"<body> \n\n "+
"\nValores recibidos del formulario: <br>"+
"\n<table cellSpacing='0' cellPadding='0'>\n\t"+
"<tr>\n\t\t<td>CUIT: "+nro_cuit+"</td></tr>"+
"\n\t<tr>\n\t\t<td>op2: "+op2+"</td></tr>"+
"</table>");
res=this.abComercio (id_comercio, op2);
//out.println("<br><br>Insert: "+res);
if (res != null && res.equals("1"))
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\");} \n document.body.style.background='green'; window.setTimeout(go, 40); \n</script>\n</body>\n</html>");
else
out.println("<script>function go() {window.location.replace(\"/ameca/comercios?operacion=detalle&id_comercio="+id_comercio+"\");} \n document.body.style.background='red'; window.setTimeout(go, 9000); \n</script><br><br>query: "+res+"\n\n</body>\n</html>");
}
}
// Recibe el id_comercio y devuelve una tabla html con sus datos
private String DatosComercioTable(String id_comercio)
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
int id_localidad=0;
String razon_social="", nombre_responsable="", domicilio_fiscal="", nro_telefono="", email="", nro_cuit="";
String resul="", codigo_postal="", periodo_baja="", observaciones="", periodo_alta="", nro_telefono2="", nro_cuit_admin="";
try
{
con=CX.getCx_pool();
pst = con.prepareStatement( "SELECT nro_cuit, razon_social, nombre_responsable, domicilio_fiscal, periodo_alta, id_localidad, nro_telefono, email, " +
"codigo_postal, periodo_baja, observaciones_comercio, nro_telefono2, nro_cuit_admin "+ // 13
" FROM Comercios"+
" WHERE id_comercio="+id_comercio);
rs = pst.executeQuery();
if (rs.next())
{
nro_cuit=rs.getString(1);
razon_social=rs.getString(2);
nombre_responsable=rs.getString(3);
domicilio_fiscal=rs.getString(4);
periodo_alta=rs.getString(5)!= null ? rs.getString(5) : "" ;
id_localidad=rs.getInt(6);
nro_telefono=rs.getString(7);
email=rs.getString(8);
codigo_postal=rs.getString(9)!= null ? rs.getString(9) : "" ;
periodo_baja=rs.getString(10)!= null ? rs.getString(10) : "" ;
observaciones=rs.getString(11);
nro_telefono2=rs.getString(12);
nro_cuit_admin=rs.getString(13);
}
resul="<table><tr>\n\t\t<td>CUIT: <b>"+nro_cuit+"</b></td></tr>"+
"<tr>\n\t\t<td>CUIT Admin.: <b>"+nro_cuit_admin+"</b></td></tr>"+
"<tr>\n\t\t<td>Razon Social: <b>"+razon_social+"</b></td></tr>"+
"\n\t<tr>\n\t\t<td>Nombre Responsable: <b>"+nombre_responsable+"</b></td></tr>"+
"\n\t<tr>\n\t\t<td height='2px'></td></tr> "+
"\n\t<tr>\n\t\t<td>Domicilio Fiscal: <b>"+domicilio_fiscal+"</b></td></tr>"+
"\n\t<tr>\n\t\t<td>"+this.getPerfilImpositivo(id_comercio)+"</td></tr>"+
"\n\t<tr>\n\t\t<td>Provincia: <b>"+htm.getProvincia_localidad(id_localidad)+"</b></td></tr>"+
"\n\t<tr>\n\t\t<td>Código Postal: <b>"+codigo_postal+"</b></td></tr>"+
"\n\t<tr>\n\t\t<td>Localidad: <b>"+htm.getLocalidad(id_localidad)+"</b></td></tr>"+
"\n\t<tr>\n\t\t<td>Telefono: <b>"+nro_telefono+"</b></td></tr>" +
"\n\t<tr>\n\t\t<td>Telefono2: <b>"+nro_telefono2+"</b></td></tr>" +
"\n\t<tr>\n\t\t<td>E-Mail: <b>"+email+"</b></td></tr>" +
"\n\t<tr>\n\t\t<td>Fecha de Alta: <b>"+periodo_alta+"</b></td></tr>" +
"\n\t<tr>\n\t\t<td>Fecha de Baja: <b>"+periodo_baja+"</b></td></tr>" +
"\n\t<tr>\n\t\t<td>Observaciones:</td></tr> "+
"\n\t<tr>\n\t\t<td height='2px'></td></tr> "+
"<tr><td><textarea name='observaciones' cols='60' rows='8'>"+observaciones+"</textarea></td></tr>" +
"\n\t<tr>\n\t\t<td align='center'><br><a href='/ameca/liquidaciones?operacion=ver_c&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"&periodo="+htm.getPeriodo_nostatic()+"'>Ver D.D.J.J s</a></td></tr>" +
"\n\t<tr>\n\t\t<td align='center'><br><a href='/ameca/comercios?operacion=compras&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"&nombre_responsable="+URLEncoder.encode(nombre_responsable, "UTF-8")+"&periodo="+htm.getPeriodo_nostatic()+"'>Resumen Compras</a></td></tr>" +
"\n\t<tr>\n\t\t<td align='center'><br><a href='/ameca/comercios?operacion=new&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"&razon_social="+URLEncoder.encode(razon_social)+"&nombre_responsable="+URLEncoder.encode(nombre_responsable)+
"&domicilio_fiscal="+URLEncoder.encode(domicilio_fiscal)+"&id_localidad="+id_localidad+"&codigo_postal="+codigo_postal+"&nro_telefono="+nro_telefono+"&nro_telefono2="+nro_telefono2+
"&email="+URLEncoder.encode(email)+"&observaciones="+URLEncoder.encode(observaciones)+"&periodo_alta="+periodo_alta+"&periodo_baja="+periodo_baja+"&nro_cuit_admin="+nro_cuit_admin+"'>Editar Comercio</a></td></tr>" +
"</table>";
}
catch (Exception ex) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= ex.getMessage();
}
}
return resul; //tabla con datos del comercio
}
// Recibe el id_comercio y devuelve una tabla html con los datos de sus establecimientos
private String DatosEstablecimientoTable(String id_comercio, String nro_cuit)
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
/* String query="SELECT e.id_establecimiento, nombre_establecimiento, direccion_establecimiento, " +// 3
"id_zona, e.id_localidad, id_actividad, nro_telefono_establecimiento, email_establecimiento, "+ // 8
"nombre_responsable_establecimiento, nro_telefono2_establecimiento, nro_pago_facil, "+ // 11
"cod_postal_establecimiento, em.alicuota_pago_facil, em.saldo_iva, em.saldo_iibb, "+ // 15
"em.reporte_gan, em.reporte_afip_esp, em.reporte_suss, em.reporte_ameca_comision," + // 19
"activo_iibb_periodo, activo_iva_periodo, c.id_condicion_iva, id_condicion_iibb " + //23
" FROM Establecimientos e, EstablecimientosLiquiMes em, Comercios c "+
" WHERE e.id_establecimiento=em.id_establecimiento AND e.id_comercio="+id_comercio+
" AND c.id_comercio=e.id_comercio AND periodo= '"+HTML.getPeriodo()+"' ";
*/ String query="SELECT e.id_establecimiento, nombre_establecimiento, direccion_establecimiento, " +// 3
"id_zona, e.id_localidad, id_actividad, nro_telefono_establecimiento, email_establecimiento, "+ // 8
"nombre_responsable_establecimiento, nro_telefono2_establecimiento, nro_pago_facil, "+ // 11
"cod_postal_establecimiento, em.alicuota_pago_facil, em.saldo_iva, em.saldo_iibb, "+ // 15
"em.reporte_gan, em.reporte_afip_esp, em.reporte_suss, em.reporte_ameca_comision," + // 19
"activo_iibb_periodo, activo_iva_periodo, c.id_condicion_iva, id_condicion_iibb, periodo, " + //24
"(SELECT COUNT(*) from Establecimientos ee where ee.id_comercio="+id_comercio+") as 'count', " + //25
"em.base_imponible, em.compra_iva, em.percepcion_iva, percepcion_iibb, em.saldo_iva_reporte, em.saldo_iibb_reporte, " + // 31
"c.nombre_responsable, e.casa_matriz, c.nro_cuit " + // 34
" FROM Establecimientos e LEFT JOIN EstablecimientosLiquiMes em USING(id_establecimiento) LEFT JOIN Comercios c USING (id_comercio) "+
" WHERE e.id_comercio="+id_comercio+
" ORDER BY periodo DESC";
String resul="", nombre_establecimiento, direccion_establecimiento, tel1, tel2, email, periodo,
responsable, nro_pago_facil, cod_postal, debug="", nombre_responsable="", casa_matriz;
int id_establecimiento=0, id_zona, id_localidad, id_actividad, activo_iibb=0, activo_iva=0, condicion_iva=0, condicion_iibb=0;
Double alicpf=0d, saldoivaf=0d, saldoiibbf=0d, ganf=0d, afipf=0d, sussf=0d, comisionf=0d, subtotalf=0d, saldopf=0d, totalf=0d,
bi=0d, compra_iva=0d, pcp_iva=0d, pcp_iibb=0d, saldoiva_reportef=0d, saldoiibb_reportef=0d;
//Double bi_d=0d;
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(query);
rs = pst.executeQuery();
resul="\n<table cellpadding='2' cellspacing='2' border='0' width='100%'><tr>\n\n";
int i=0, tot_establecs=0, vueltas=0; // contador de establecimientos impresos y cant de establecimientos
int [] establecs=new int[9];
Boolean salgo=false, salteo=false; // cuando obtengo todos los establecimientos salgo del query
while (rs.next() && !salgo)
{ vueltas++;
// preguntar si periodo is null, y mostrar solo los id_establecimientos distintos una vez , query me dice la cant de establecimientos del comercio (salir del while cuando encuentro los tres)
// while (rs.next() && i<count )
tot_establecs=rs.getInt(25);
id_establecimiento=rs.getInt(1);
periodo = rs.getString(24) != null ? rs.getString(24) : "0" ;
salteo=false;
for (int z=0;z<i;z++)
if (establecs[z]==id_establecimiento)
{salteo=true;
z=i;
//debug+="salteo<br>";
}
if(!salteo)
{
// debug+="entro a imprimir... vuelta: "+Integer.toString(vueltas)+", i="+Integer.toString(i)+"<br>";
establecs[i++]=id_establecimiento;
nombre_establecimiento=rs.getString(2);
direccion_establecimiento=rs.getString(3);
id_zona=rs.getInt(4);
id_localidad=rs.getInt(5);
id_actividad=rs.getInt(6);
tel1=rs.getString(7);
tel2=rs.getString(10);
email=rs.getString(8);
responsable=rs.getString(9);
nombre_responsable=rs.getString(32);
casa_matriz=rs.getString(33);
nro_cuit=rs.getString(34);
nro_pago_facil=rs.getString(11);
cod_postal=rs.getString(12);
if (periodo.equals(htm.getPeriodo_nostatic()))
{
alicpf=rs.getDouble(13);
saldoivaf=rs.getDouble(14);
saldoiibbf=rs.getDouble(15);
saldoiva_reportef=rs.getDouble(30);
saldoiibb_reportef=rs.getDouble(31);
ganf=rs.getDouble(16);
afipf=rs.getDouble(17);
sussf=rs.getDouble(18);
comisionf=rs.getDouble(19);
bi=rs.getDouble(26);
compra_iva=rs.getDouble(27);
pcp_iva=rs.getDouble(28);
pcp_iibb=rs.getDouble(29);
subtotalf=saldoivaf + saldoiibbf + ganf + afipf + sussf; // total vep
saldopf=subtotalf * alicpf/100;
totalf=subtotalf + saldopf + comisionf; // total pago facil -- faltaria sumar autonomo / monotributo si hay tilde
activo_iibb=rs.getInt(20);
activo_iva=rs.getInt(21);
condicion_iva=rs.getInt(22);
condicion_iibb=rs.getInt(23);
}
else
{
alicpf=0d;
saldoivaf=0d;
saldoiibbf=0d;
ganf=0d;
afipf=0d;
sussf=0d;
comisionf=0d;
subtotalf=0d;
saldopf=0d;
totalf=0d;
bi=0d;
compra_iva=0d;
pcp_iva=0d;
pcp_iibb=0d;
activo_iibb=0;
activo_iva=0;
condicion_iva=0;
condicion_iibb=0;
}
// nuevo saldo del reporte saldoivaf=rs.getFloat(3);
// nuevo campo saldoiibbf=rs.getFloat(4);
resul+="<td valign='top'>\n"+
"\n <table border='1' cellpadding='2' cellspacing='0'> "+
"\n <tr> <td width='380px' height='25'> <table width='100%'><tr><td> Dirección: "+direccion_establecimiento+" </td><td valign='right'><a href='/ameca/establecimientos?operacion=new&id_establecimiento=" + id_establecimiento + "&id_comercio=" + id_comercio + "&nombre_establecimiento=" + URLEncoder.encode(nombre_establecimiento) + "&direccion_establecimiento=" + URLEncoder.encode(direccion_establecimiento)
+ "&codigo_postal=" + cod_postal + "&id_zona=" + id_zona + "&id_localidad=" + id_localidad + "&id_actividad=" + id_actividad + "&email_establecimiento=" + URLEncoder.encode(email)
+ "&nro_telefono_establecimiento=" + tel1 + "&nro_telefono2_establecimiento=" + tel2 + "&nro_pago_facil=" + nro_pago_facil + "&casa_matriz="+casa_matriz+"'><img src=\"/ameca/imgs/edit32.png\" alt='search' align='bottom'></a> </td> </tr></table> </td> </tr>"+
// "\n\t<tr> <td height='1px'> </td></tr> \n"+
"\n\t<tr> <td> \n";
if (casa_matriz.equals("1"))
resul+="<p style='color:black; background-color:lightblue; margin-top: 1px; font-family: Arial, Helvetica, sans-serif;'> Casa Matriz</p>\n\t";
else
resul+="<p style='color:black; background-color:lightgrey; margin-top: 1px; font-family: Arial, Helvetica, sans-serif;'> Sucursal</p>\n\t";
resul+="\t\t Nombre: "+nombre_establecimiento+"<br>\n\t"+
"\n\t Código Postal: "+cod_postal+"<br>\n\t"+
"\t\t Actividad: "+htm.getActividad(id_actividad)+"<br>\n\t"+
"\t\t Provincia: "+htm.getProvincia_localidad(id_localidad)+"<br>\n\t"+
"\t\t Localidad: "+htm.getLocalidad(id_localidad)+"<br>\n\t" +
"\t\t Zona: "+htm.getZona(id_zona)+"<br>\n\t" +
"\n\t Nombre Contacto: "+responsable+"<br>\n\t"+
"\t\t Teléfono: "+tel1+"<br>\n\t" +
"\t\t Teléfono2: "+tel2+"<br>\n\t" +
"\t\t E-mail: "+email+"\n\t <br>"+
"\t\t Número Pago Fácil: "+nro_pago_facil+"\n\t "+
"\t\t<table cellspacing='0'><tr><td> Observaciones:</td><td width='20'></td><td> <a href=\"#\" onClick=\"MyWindow=window.open('/ameca/establecimientos?operacion=notes&nombre_responsable_establecimiento="+URLEncoder.encode(nombre_responsable)+"&direccion_establecimiento="+URLEncoder.encode(direccion_establecimiento)+"&nro_cuit="+nro_cuit+"&id_establecimiento="+id_establecimiento+"','MyWindow','width=600,height=300'); return false;\"><img src=\"/ameca/imgs/notepad.png\" style=\"width:32px;height:32px;\" onmouseover=\"this.style.cursor='pointer'\">\n</a></td></tr></table> <br>\n\t <br>";
if (activo_iva>0 ) // && condicion_iva!=1 solo sacar el href que permite incluirlo incluye
{resul+="<img src='/ameca/imgs/green_yes.png' style='width:21px;height:21px;'> <b>IVA</b>: ACTIVO. <a href='/ameca/establecimientos?operacion=activar&op_activar=iva&valor_activar=0&id_establecimiento="+id_establecimiento+"&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"'> Excluir <img src='/ameca/imgs/red_no.png' style='width:11px;height:11px;'></a>"+
"\n <br> Base: $"+String.format(Locale.GERMAN, "%,.2f", bi)+
"\n <br> Compra: $"+String.format(Locale.GERMAN, "%,.2f", compra_iva)+
"\n <br> Percepcion: $"+String.format(Locale.GERMAN, "%,.2f", pcp_iva)+
"\n\t <br> Saldo IVA: $ "+String.format(Locale.GERMAN, "%,.2f", saldoivaf)+"<br>\n\t";
}
else
{
resul+="<img src='/ameca/imgs/red_no.png' style='width:21px;height:21px;'>IVA: INACTIVO. ";
if (HTML.getActivo_iva(condicion_iva))
resul+="<a href='/ameca/establecimientos?operacion=activar&op_activar=iva&valor_activar=1&id_establecimiento="+id_establecimiento+"&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"'> Incluir <img src='/ameca/imgs/green_yes.png' style='width:11px;height:11px;'></a>";
}
if (activo_iibb>0)
{resul+="<br><img src='/ameca/imgs/green_yes.png' style='width:21px;height:21px;'> <b>IIBB</b>: ACTIVO. <a href='/ameca/establecimientos?operacion=activar&op_activar=iibb&valor_activar=0&id_establecimiento="+id_establecimiento+"&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"'> Excluir <img src='/ameca/imgs/red_no.png' style='width:11px;height:11px;'></a>";
if (activo_iva==0 )
resul+="\n <br> Base: $"+String.format(Locale.GERMAN, "%,.2f", bi);
resul+="\n <br> Percepcion: $"+String.format(Locale.GERMAN, "%,.2f", pcp_iibb)+
"\n\t <br> Saldo IIBB: $ "+String.format(Locale.GERMAN, "%,.2f", saldoiibbf)+"<br>\n\t";
}
else
{
resul+="<br><img src='/ameca/imgs/red_no.png' style='width:21px;height:21px;'> IIBB: INACTIVO. ";
if (HTML.getActivo_iibb(condicion_iibb))
resul+="<a href='/ameca/establecimientos?operacion=activar&op_activar=iibb&valor_activar=1&id_establecimiento="+id_establecimiento+"&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"'> Incluir <img src='/ameca/imgs/green_yes.png' style='width:11px;height:11px;'></a>";
}
resul+="\n <br><br> <b>Reporte:</b> <a href='/ameca/reportes?operacion=edit&id_establecimiento=" + id_establecimiento + "&periodo=" + periodo + "&direccion_establecimiento=" + URLEncoder.encode(direccion_establecimiento) + "&nro_cuit="+nro_cuit+"'>Editar</a><br> "+
"\n<table>";
if (saldoiva_reportef>0f && Math.round(saldoiva_reportef - saldoivaf) !=0)
resul+="\n\t<tr>\n\t\t<td>Saldo IVA: $ "+String.format(Locale.GERMAN, "%,.2f",saldoiva_reportef)+"<br>\n\t";
if (saldoiibb_reportef>0f && Math.round(saldoiibb_reportef - saldoiibbf )!=0)
resul+="\n\t<tr>\n\t\t<td>Saldo IIBB: $ "+String.format(Locale.GERMAN, "%,.2f",saldoiibb_reportef)+"<br>\n\t";
resul+="\t\tGAN.: $ "+String.format(Locale.GERMAN, "%,.2f",ganf)+"<br>\n\t"+
"\t\tAFIP esp.: $ "+String.format(Locale.GERMAN, "%,.2f",afipf)+"<br>\n\t"+
"\t\tSUSS.: $ "+String.format(Locale.GERMAN, "%,.2f",sussf)+"<br>\n\t"+
"\t\tTotal VEP: $ "+String.format(Locale.GERMAN, "%,.2f",subtotalf)+"<br>\n\t"+
"\t\tSaldo Pago Facil.: $ "+String.format(Locale.GERMAN, "%,.2f",saldopf)+"<br>\n\t"+
"\t\tTotal Pago Facil: $ "+String.format(Locale.GERMAN, "%,.2f",totalf)+"<br>\n\t"+
"\n\t</td></tr><tr><td height=10px></td></tr>"+
"</table>"+
"</td> </tr> "+
// "\n\t<tr> <td height='1px'> </td></tr> \n"+
"<tr> <td> "+
"<table border='0'><tr><td> \n</td>"+
"<td><a href='/ameca/establecimientos?operacion=liqui&id_establecimiento="+id_establecimiento+"&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"&periodo="+htm.getPeriodo_nostatic()+"&direccion_establecimiento="+URLEncoder.encode(direccion_establecimiento)+"'>Editar Base</a> | </td>\n"+
"<td><a href='/ameca/liquidaciones?operacion=ver_e&id_establecimiento="+id_establecimiento+"&id_comercio="+id_comercio+"&direccion_establecimiento="+URLEncoder.encode(direccion_establecimiento)+"&periodo="+htm.getPeriodo_nostatic()+"&nro_cuit="+nro_cuit+"'>Ver DDJJs</a> </td></tr>"+
"</table>\n";
resul+="\n\t</td></tr></table>\n\n";
resul+="\n\t</td><td width='10px'></td>";
} // fin del if del salteo
if(i==tot_establecs)
{salgo=true;
debug+="<br>salgo:"+Boolean.toString(salgo)+"<br>";
}
} // fin while
// resul+="\n\t<tr>\n\t\t<td align='center'><br><a href='/ameca/establecimientos?operacion=new&id_comercio="+id_comercio+"&nro_cuit="+nro_cuit+"&activo_iibb="+Integer.toString(activo_iibb)+"&activo_iva="+Integer.toString(activo_iva)+"'>Agregar Nuevo Establecimiento</a></td>\n\t</tr>";
// resul+="\n</tr><tr><td>debuging="+debug+"</td></tr></table>";
if (vueltas>2) // agrego columna si hubo menos de tres establecimientos
resul+="\n</tr></table>";
else
resul+="\n\n\t</td><td width='200px'> <br></td></tr></table>";
}
catch (SQLException ex) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= ex.getMessage();
}
}
return resul; //tabla con establecimientos del comercio activo
}
private String getPerfilImpositivo(String id_comercio)
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
String resul="";
try
{
con=CX.getCx_pool();
pst = con.prepareStatement( "SELECT id_condicion_iibb, id_condicion_iva, id_categ_monotributo, id_categ_autonomo, nro_cuit, nombre_responsable, domicilio_fiscal "+
" FROM Comercios "+
" WHERE id_comercio="+id_comercio);
rs = pst.executeQuery();
if (rs.next())
resul="\n<table border='1' cellpadding='3' cellspacing='0' width='400px'>"+
"\n\t<tr>\n\t\t<td><table><tr><td width='300px' align='center'><b> Perfil Impositivo</b></td> "
+ "<td align='right' width='100px'><a href='/ameca/comercios?operacion=perfil&id_comercio=" + id_comercio + "&nro_cuit=" + rs.getString(5) + "&condicion_iibb=" + rs.getString(1) + "&condicion_iva=" + rs.getString(2) + "&categ_monotributo=" + rs.getString(3) + "&categ_autonomo=" + rs.getString(4) + "&nombre_responsable=" + URLEncoder.encode(rs.getString(6)) + "&domicilio_fiscal=" + URLEncoder.encode(rs.getString(7) )+ "'> "
+ "<img src=\"/ameca/imgs/edit32.png\" alt='search' align='bottom'></a> </td> </tr></table> "
+ "</td></tr> \n\t"
+ "\n\t<tr>\n\t\t<td>Condicion I.I.B.B.: <b>"+HTML.getCondicionIIBB(rs.getInt(1))+"</b><br>\n\t"+
"\t\tCondicion I.V.A.: <b>"+HTML.getCondicionIVA(rs.getInt(2))+"</b><br>\n\t"+
"<br>\t\t"+HTML.getCategoriaMonotributo(rs.getInt(3))+"\n\t"+
"\t\t"+HTML.getCategoriaAutonomo(rs.getInt(4))+"<br>\n\t"+
"\n\t</td></tr></table><br>\n";
else
resul="\n<table border='1' cellpadding='0' cellspacing='0'>"+
"\n\t<tr>\n\t\t<td><table width='400px'><tr><td width='300px'><b> Perfil Impositivo</b></td> "
+ "<td align='right' width='100px'><a href='/ameca/comercios?operacion=perfil&id_comercio=" + id_comercio+ "'> "
+ "<img src=\"/ameca/imgs/edit32.png\" alt='search' align='bottom'></a> </td> </tr></table> "
+ "</td></tr> \n\t"
+ "\n\t<tr>\n\t\t<td>Condicion I.I.B.B.: <br>\n\t"+
"\t\tCondicion I.V.A.: <br>\n\t"+
"<br>\n\t"+
"\n\t</td></tr></table><br>\n";
// resul+="\n\t<tr>\n\t\t<td align='center'><br><a href='/ameca/comercios?operacion=perfil&id_comercio="+id_comercio+"&nro_cuit="+rs.getString(5)+"&condicion_iibb="+rs.getString(1)+"&condicion_iva="+rs.getString(2)+"&categ_monotributo="+rs.getString(3)+"&categ_autonomo="+rs.getString(4)+"&nombre_responsable="+rs.getString(6)+"&domicilio_fiscal="+rs.getString(7)+"'>Editar</a></td>\n\t</tr>";
}
catch (SQLException ex) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= ex.getMessage();
}
}
return resul; //tabla con establecimientos del comercio activo
}
private String getReportes_table(String id_comercio)
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
Float ganf=0f, afipf=0f, sussf=0f, saldoivaf=0f, saldoiibbf=0f, alicpf=0f, comisionf=0f, subtotalf=0f, saldopf=0f, totalf=0f;
String resul="";
try
{
con=CX.getCx_pool();
pst = con.prepareStatement( "SELECT em.alicuota_pago_facil, em.saldo_iva, em.saldo_iibb, em.reporte_gan, em.reporte_afip_esp, "+ // 5
"em.reporte_suss, em.reporte_ameca_comision, e.direccion_establecimiento, e.id_establecimiento "+ // 9
" FROM EstablecimientosLiquiMes em, Establecimientos e "+
" WHERE e.id_establecimiento=em.id_establecimiento AND e.id_comercio="+id_comercio+
" AND periodo='"+htm.getPeriodo_nostatic()+"' ");
rs = pst.executeQuery();
resul="\n<table cellpadding='0' cellspacing='0'> \n\n";
while (rs.next())
{
alicpf=rs.getFloat(1);
saldoivaf=rs.getFloat(2);
saldoiibbf=rs.getFloat(3);
ganf=rs.getFloat(4);
afipf=rs.getFloat(5);
sussf=rs.getFloat(6);
comisionf=rs.getFloat(7);
// subtotal=htm.getSubtotalReporte_calculo (saldo_iva, saldo_iibb, gan, afip, suss);
subtotalf=saldoivaf + saldoiibbf + ganf + afipf + sussf;
saldopf=subtotalf * alicpf/100;
totalf=subtotalf + subtotalf + comisionf;
resul+="<tr><td>\n<table border='1' cellpadding='0' cellspacing='0'>"+
"\n\t<tr>\n\t\t<td>Dir..: <b>"+rs.getString(8)+"</b> <a href='/ameca/reporte?operacion=perfil&id_establecimiento="+rs.getString(9)+"'>Editar</a></td> </tr>"+
"\n\t<tr>\n\t\t<td>Alicuota PF.: <b>"+alicpf+"%</b><br>\n\t"+
"\n\t\n\t\tSaldo IIBB. (puede ser diferente que saldo): <b>"+String.format(Locale.GERMAN, "%,.2f",saldoiibbf)+"</b>$<br>\n\t"+
"\n\t\n\t\tSaldo IVA.: <b>"+String.format(Locale.GERMAN, "%,.2f",saldoivaf)+"</b>$<br>\n\t"+
"\t\tGAN.: <b>"+String.format(Locale.GERMAN, "%,.2f",ganf)+"</b>$<br>\n\t"+
"\t\tAFIP esp.: <b>"+String.format(Locale.GERMAN, "%,.2f",afipf)+"</b>$<br>\n\t"+
"\t\tSUSS.: <b>"+String.format(Locale.GERMAN, "%,.2f",sussf)+"</b>$<br>\n\t"+
"\t\tComision Ameca.: <b>"+String.format(Locale.GERMAN, "%,.2f",comisionf)+"</b>$<br><br>\n\t"+
"\t\tSubtotal.: <b>"+String.format(Locale.GERMAN, "%,.2f",subtotalf)+"</b>$<br>\n\t"+
"\t\tSaldo Pago Facil.: <b>"+String.format(Locale.GERMAN, "%,.2f",saldopf)+"</b>$<br>\n\t"+
"\t\t<b>TOTAL.: "+String.format(Locale.GERMAN, "%,.2f",totalf)+"</b>$<br>\n\t"+
"\n\t</td></tr></table><br>\n\n "+
"\n\t</td></tr>"+
"\n\t<tr>\n\t\t<td align='center'><br></td>\n\t</tr>";
}
resul+="\n</table>";
}
catch (Exception ex) {
resul+= "<br><br>ERROR gral: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul+= ex.getMessage();
}
}
return resul; //tabla con establecimientos del comercio activo
}
// update del perfil impositivo sobre tabla Comercios y devuelve los registros modificados (1 si todo ok)
private String updateComercio_perfil (String id_comercio, String condicion_iibb, String condicion_iva, String categ_autonomo, String categ_monotributo)
{
Connection con = null;
ResultSet rs = null;
PreparedStatement pst = null;
int resul_insert;
String resul="UPDATE Comercios set id_condicion_iibb="+condicion_iibb+", id_condicion_iva="+condicion_iva+", "
+ "id_categ_monotributo="+categ_monotributo+", id_categ_autonomo="+categ_autonomo+" "
+ " WHERE id_comercio="+id_comercio;
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(resul);
resul_insert = pst.executeUpdate();
resul=Integer.toString(resul_insert);
if(resul_insert<1)
resul="problema en update comercio";
pst = con.prepareStatement("Select count(*) from Establecimientos WHERE id_comercio="+id_comercio);
rs=pst.executeQuery();
if (rs.next())
resul_insert=rs.getInt(1);
if(resul_insert>0)
{
/* esto queda afuera porque activo_iva y activo_iibb es manual, igual no va a aparecer en el listado si condicion iva es monotributo... */
if (condicion_iva.equals("1"))
pst = con.prepareStatement("UPDATE Establecimientos e, EstablecimientosLiquiMes em SET em.activo_iva_periodo=0 WHERE em.id_establecimiento=e.id_establecimiento AND em.periodo='"+htm.getPeriodo_nostatic()+"' AND e.id_comercio="+id_comercio);
else if (condicion_iva.equals("2"))
pst = con.prepareStatement("UPDATE Establecimientos e, EstablecimientosLiquiMes em SET em.activo_iva_periodo=1 WHERE em.id_establecimiento=e.id_establecimiento AND em.periodo='"+htm.getPeriodo_nostatic()+"' AND e.id_comercio="+id_comercio);
resul_insert = pst.executeUpdate();
if(resul_insert<1)
resul+="problema en update activo_iva";
else
resul+=Integer.toString(resul_insert);
if (condicion_iibb.equals("2") || condicion_iibb.equals("4") || condicion_iibb.equals("5") )
pst = con.prepareStatement("UPDATE Establecimientos e, EstablecimientosLiquiMes em SET em.activo_iibb_periodo=0 WHERE em.id_establecimiento=e.id_establecimiento AND em.periodo='"+htm.getPeriodo_nostatic()+"' AND e.id_comercio="+id_comercio);
else if (condicion_iva.equals("2"))
pst = con.prepareStatement("UPDATE Establecimientos e, EstablecimientosLiquiMes em SET em.activo_iibb_periodo=1 WHERE em.id_establecimiento=e.id_establecimiento AND em.periodo='"+htm.getPeriodo_nostatic()+"' AND e.id_comercio="+id_comercio);
resul_insert = pst.executeUpdate();
if(resul_insert<1)
resul+="problema en update activo_iibb";
else
resul+=Integer.toString(resul_insert);
}
}
catch (SQLException ex) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
}
}
return resul; //id_comercio del nuevo registro
}
// inserta nuevo comercio en tabla Comercios y devuelve el id_comercio
private String insertaComercio(String nro_cuit, String razon_social, String nombre_responsable, String domicilio_fiscal, String id_localidad,
String nro_telefono, String email, String codigo_postal, String nro_telefono2, String observaciones, String nro_cuit_admin)
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
long resul_insert=0;
String resul="INSERT INTO Comercios (nro_cuit, razon_social, nombre_responsable, domicilio_fiscal, id_localidad, nro_telefono, email, "
+ " periodo_alta, periodo_baja, codigo_postal, nro_telefono2, observaciones_comercio, nro_cuit_admin) "
+ " VALUES ('"+nro_cuit+"', '"+razon_social+"', '"+nombre_responsable+"', '"+domicilio_fiscal+"', "+
id_localidad+", '"+nro_telefono+"', '"+email+"', DATE_FORMAT(CURRENT_DATE, '%Y-%m'), '-', '" +
codigo_postal+"', '"+nro_telefono2+"', '"+observaciones+"', '"+nro_cuit_admin+"')";
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(resul);
resul_insert = pst.executeUpdate();
if (resul_insert>0)
pst = con.prepareStatement("select last_insert_id()");
else
return "ERROR: "+resul;
rs=pst.executeQuery();
if (rs.next())
resul=rs.getString(1);
}
catch (SQLException ex) {
return "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
return ex.getMessage();
}
}
return resul; //id_comercio del nuevo registro
}
// update comercio en tabla Comercios y devuelve el id_comercio o cero si hubo error en update.
private String updateComercio(String id_comercio, String nro_cuit, String razon_social, String nombre_responsable, String domicilio_fiscal,
String id_localidad, String nro_telefono, String email, String periodo_alta, String nro_cuit_admin, String codigo_postal,
String nro_telefono2, String observaciones)
{
Connection con = null;
PreparedStatement pst = null;
long resul_insert;
String resul="UPDATE Comercios "+
"SET nro_cuit='"+nro_cuit+"', razon_social='"+razon_social+"', nombre_responsable='"+nombre_responsable+"', "+
"domicilio_fiscal='"+domicilio_fiscal+"', id_localidad="+id_localidad+", nro_telefono='"+nro_telefono+"', "+
"email='"+email+"', nro_cuit_admin='"+nro_cuit_admin+"', "+
"codigo_postal='"+codigo_postal+"', nro_telefono2='"+nro_telefono2+"', observaciones_comercio='"+observaciones+"' "+
"WHERE id_comercio="+id_comercio;
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(resul);
resul_insert = pst.executeUpdate();
if (resul_insert>0)
resul=id_comercio;
}
catch (SQLException ex) {
resul="<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul=ex.getMessage();
}
}
return resul; //id_comercio editado, 0 si no hizo el update o el mensaje de error
}
// recibe CUIT, entero o parte, y devuelve tabla con loc comercios que cumplen con link para editarlos
private String TablaFindComercios (String cuit_calle) // cuando busco desde la barra de tareas entra por aca
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
String query, resul="\n\n<table class='bicolor' align='center'><tr><th>CUIT</th><th>Razon Social</th><th>Responsable</th><th>Domicilio Fiscal (Comercio)</th><th>Dirección Establecimiento</th><th></th></tr>\n";
// if (StringUtils.isStrictlyNumeric(cuit_calle.substring(0,2)))
if (cuit_calle != null && cuit_calle.substring(0,2).matches("-?\\d+(\\.\\d+)?"))
query="SELECT c.id_comercio, razon_social, nombre_responsable, c.nro_cuit, domicilio_fiscal, '--' "+
"FROM Comercios c "+
"WHERE c.nro_cuit like '"+cuit_calle+"%' "+
"ORDER BY c.nro_cuit";
else
query= "SELECT c.id_comercio, razon_social, nombre_responsable, c.nro_cuit, domicilio_fiscal, direccion_establecimiento "+
"FROM Comercios c, Establecimientos e "+
"WHERE c.id_comercio=e.id_comercio AND (domicilio_fiscal like '%"+cuit_calle+"%' OR direccion_establecimiento like '%"+cuit_calle+"%') "+
"ORDER BY c.nro_cuit" ;
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(query);
rs = pst.executeQuery();
while (rs.next())
resul+="<tr><td>"+rs.getString(4)+"</td><td>"+rs.getString(2)+"</td><td>"+rs.getString(3) +"</td><td>"+rs.getString(5) +"</td><td>"+rs.getString(6) +"</td><td><a href=\"/ameca/comercios?operacion=detalle&nro_cuit="+rs.getString(4)+"&id_comercio="+rs.getString(1)+"\">Ver Comercio</a></tr>\n";
resul+="</table>";
}
catch (SQLException ex) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= ex.getMessage();
}
}
return resul; //id_comercio del nuevo registro
}
// recibe CUIT y calle (de comercio o establecimiento), entero o parte, y devuelve tabla con loc comercios que cumplen con link para editarlos
private String TablaFindComercios (String nro_cuit, String calle_comercio)
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
String query="", resul="\n\n<table class='bicolor' align='center'><tr><th>CUIT</th><th>Razon Social</th><th>Responsable</th><th>Domicilio Fiscal (Comercio)</th><th>Dirección Establecimiento</th><th></th></tr>\n";
if (nro_cuit.equals("--") && calle_comercio.equals(""))
return "";
else if (!nro_cuit.equals("--") && calle_comercio.equals(""))
query= "SELECT id_comercio, razon_social, nombre_responsable, nro_cuit, domicilio_fiscal, '--' "+
"FROM Comercios WHERE nro_cuit like '"+nro_cuit+"%' ";
else if (nro_cuit.equals("--") && !calle_comercio.equals(""))
query= "SELECT c.id_comercio, razon_social, nombre_responsable, c.nro_cuit, domicilio_fiscal, direccion_establecimiento "+
"FROM Comercios c, Establecimientos e WHERE c.id_comercio=e.id_comercio AND (domicilio_fiscal like '%"+calle_comercio+"%' OR direccion_establecimiento like '%"+calle_comercio+"%')" ;
else if (!nro_cuit.equals("--") && !calle_comercio.equals(""))
query= "SELECT c.id_comercio, razon_social, nombre_responsable, c.nro_cuit, domicilio_fiscal, direccion_establecimiento' "+
"FROM Comercios c, Establecimientos e WHERE c.id_comercio=e.id_comercio AND c.nro_cuit like '"+nro_cuit+"%' AND (direccion_establecimiento like '%"+calle_comercio+"%' OR domicilio_fiscal like '%"+calle_comercio+"%')";
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(query);
rs = pst.executeQuery();
while (rs.next())
resul+="<tr><td>"+rs.getString(4)+"</td><td>"+rs.getString(2)+"</td><td>"+rs.getString(3) +"</td><td>"+rs.getString(5) +"</td><td>"+rs.getString(6) +"</td><td><a href=\"/ameca/comercios?operacion=detalle&nro_cuit="+rs.getString(4)+"&id_comercio="+rs.getString(1)+"\">Ver Comercio</a></tr>\n";
resul+="</table>";
}
catch (SQLException ex) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= ex.getMessage();
}
}
return resul; //id_comercio del nuevo registro
}
// id_comercio, nro_cuit, nombre_responsable, periodo);
private String ResumenCompras (String id_comercio, String nro_cuit, String nombre_responsable, String periodo) // cuando busco desde la barra de tareas entra por aca
{
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
String query, imp_neto_g="", imp_neto_ng="", imp_op_ex="", imp_iva="", imp_tot="", resul="";
query="SELECT imp_neto_gravado, imp_neto_no_gravado, imp_op_exentas, iva, imp_total "+
"FROM ComerciosCompras "+
"WHERE id_comercio = "+id_comercio+" AND periodo='"+periodo+"' ";
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(query);
rs = pst.executeQuery();
if (rs.next())
{// formulario
resul= "\n<form action='/ameca/comercios' name='f_compras'> "+
"\n\n<table cellSpacing='0' cellPadding='0'>\n\t<tr><td colspan='2' align='center'>"+
"<table>"+
"<tr>\n<td> <a href='/ameca/comercios?operacion=compras&id_comercio=" + id_comercio + "&nombre_responsable=" + URLEncoder.encode(nombre_responsable) + "&nro_cuit=" + nro_cuit + "&periodo=" + htm.getPeriodo_pre(periodo) + "'><img src='/ameca/imgs/back_go.png'></a></td>"+
"<td> <input type='text' name='periodo' value='"+periodo+"' size='7'> </td>"+
"\n<td> <a href='/ameca/comercios?operacion=compras&id_comercio=" + id_comercio + "&nombre_responsable=" + URLEncoder.encode(nombre_responsable) + "&nro_cuit=" + nro_cuit + "&periodo=" + htm.getPeriodo_prox(periodo) + "'><img src='/ameca/imgs/next_go.png'></a></td></tr>\n"+
"</table></td></tr>\n\n"+
"<br>" +
"<input type='hidden' name='operacion' value='compras'> "+
"<input type='hidden' name='id_comercio' value='" + id_comercio + "'>"+
"<input type='hidden' name='op2' value='update'>"+
"\n\n"+
"<tr>\n\t\t<td>Impuesto Neto Gravado: </td><td><input type='text' name='imp_neto_g' value='"+rs.getFloat(1)+"'></td></tr>"+
"<tr>\n\t\t<td>Impuesto Neto No Gravado: </td><td><input type='text' name='imp_neto_ng' value='"+rs.getFloat(2)+"'></td></tr>"+
"<tr>\n\t\t<td>Impuesto Op. Exentas: </td><td><input type='text' name='imp_op_ex' value='"+rs.getFloat(3)+"'></td></tr>"+
"<tr>\n\t\t<td>IVA: </td><td><input type='text' name='imp_iva' value='"+rs.getFloat(4)+"'></td></tr>"+
"<tr>\n\t\t<td>Impuesto Total: </td><td><input type='text' name='imp_tot' value='"+rs.getFloat(5)+"'></td></tr>"+
"<tr><td colspan=2 align='center'> <img src=\"/ameca/imgs/ok.png\" style=\"width:48px;height:48px;\" onclick=\"document.f_compras.submit();\" onmouseover=\"this.style.cursor='pointer'\"> </td></tr>" +
"</table>" +
"</form>";
}
else // formulario vacio
{// formulario
resul= "\n<form action='/ameca/comercios' name='f_compras'> "+
"\n\n<table cellSpacing='0' cellPadding='0'>\n\t<tr><td colspan='2' align='center'>"+
"<table>"+
"<tr>\n<td> <a href='/ameca/comercios?operacion=compras&id_comercio=" + id_comercio + "&nombre_responsable=" + URLEncoder.encode(nombre_responsable) + "&nro_cuit=" + nro_cuit + "&periodo=" + htm.getPeriodo_pre(periodo) + "'><img src='/ameca/imgs/back_go.png'></a></td>"+
"<td> <input type='text' name='periodo' value='"+periodo+"' size='7'> </td>"+
"\n<td> <a href='/ameca/comercios?operacion=compras&id_comercio=" + id_comercio + "&nombre_responsable=" + URLEncoder.encode(nombre_responsable) + "&nro_cuit=" + nro_cuit + "&periodo=" + htm.getPeriodo_prox(periodo) + "'><img src='/ameca/imgs/next_go.png'></a></td></tr>\n"+
"</table></td></tr>\n\n"+
"<br>" +
"<input type='hidden' name='operacion' value='compras'> "+
"<input type='hidden' name='id_comercio' value='" + id_comercio + "'>"+
"<input type='hidden' name='op2' value='insert'>"+
""+
"<tr>\n\t\t<td>Impuesto Neto Gravado: </td><td><input type='text' name='imp_neto_g' ></td></tr>"+
"<tr>\n\t\t<td>Impuesto Neto No Gravado: </td><td><input type='text' name='imp_neto_ng' ></td></tr>"+
"<tr>\n\t\t<td>Impuesto Op. Exentas: </td><td><input type='text' name='imp_op_ex' ></td></tr>"+
"<tr>\n\t\t<td>IVA: </td><td><input type='text' name='imp_iva' ></td></tr>"+
"<tr>\n\t\t<td>Impuesto Total: </td><td><input type='text' name='imp_tot' ></td></tr>"+
"<tr><td colspan=2 align='center'> <img src=\"/ameca/imgs/ok.png\" style=\"width:48px;height:48px;\" onclick=\"document.f_compras.submit();\" onmouseover=\"this.style.cursor='pointer'\"> </td></tr>" +
"</table>" +
"</form>";
}
query="SELECT periodo, imp_neto_gravado, imp_neto_no_gravado, imp_op_exentas, iva, imp_total "+
"FROM ComerciosCompras "+
"WHERE id_comercio = "+id_comercio+
" ORDER BY periodo DESC"+
" LIMIT 10";
resul+="\n\n<br><br><br><br><br><br><table class='bicolor' align='center'>"
+ "<tr><th>PERIODO</th><th>IMPUESTO NETO GRAVADO</th><th>IMPUESTO NETO NO GRAVADO</th><th>IMPUESTO OP. EXENTAS</th><th>IVA</th><th>IMPUESTO TOTAL</th>"
+ "</tr>\n";
pst = con.prepareStatement(query);
rs = pst.executeQuery();
while (rs.next())
resul+="<tr><td>"+rs.getString(1)+"</td><td>"+rs.getString(2)+"</td><td>"+rs.getString(3) +"</td><td>"+rs.getString(4) +"</td><td>"+rs.getString(5) +"</td><td>"+rs.getString(6)+"</td></tr>\n";
resul+="</table>";
}
catch (SQLException ex) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= ex.getMessage();
}
}
return resul; //id_comercio del nuevo registro
}
// update del perfil impositivo sobre tabla Comercios y devuelve los registros modificados (1 si todo ok)
private String updateResumenCompras (Boolean op2, String periodo, String id_comercio, String imp_neto_gravado, String imp_neto_no_gravado, String imp_op_exentas, String imp_iva, String imp_total)
{
Connection con = null;
PreparedStatement pst = null;
int resul_insert;
String resul="";
if (op2)
resul="UPDATE ComerciosCompras SET imp_neto_gravado="+imp_neto_gravado+", imp_neto_no_gravado="+imp_neto_no_gravado+", "
+ "imp_op_exentas="+imp_op_exentas+", iva="+imp_iva+", imp_total= "+imp_total
+ " WHERE id_comercio="+id_comercio +" AND periodo='"+periodo+"' ";
else
resul="INSERT INTO ComerciosCompras ( imp_neto_gravado, imp_neto_no_gravado, imp_op_exentas, iva, imp_total, id_comercio, periodo)"
+ " VALUES ( "+imp_neto_gravado+", "+imp_neto_no_gravado+", "+imp_op_exentas+", "+imp_iva+", "+imp_total+ ", "+id_comercio+", '"+periodo+"' )";
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(resul);
resul_insert = pst.executeUpdate();
//resul=Integer.toString(resul_insert);
resul="";
if(resul_insert<1)
resul="problema en update comercio";
}
catch (SQLException ex ) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
}
}
return resul;
}
// update periodo_baja en tabla Comercios y devuelve 1 si operacion ok o 'hubo problemas' si no
private String abComercio (String id_comercio, String op2)
{
Connection con = null;
PreparedStatement pst = null;
int resul_insert;
String resul="";
if (op2.equals("alta"))
resul="UPDATE Comercios SET periodo_baja='-' "+
" WHERE id_comercio="+id_comercio;
else
resul="UPDATE Comercios SET periodo_baja=DATE_FORMAT(CURRENT_DATE, '%Y-%m')"+
" WHERE id_comercio="+id_comercio;
try
{
con=CX.getCx_pool();
pst = con.prepareStatement(resul);
resul_insert = pst.executeUpdate();
resul="1";
if(resul_insert<1)
resul="problema en update comercio";
}
catch (SQLException ex ) {
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
//Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
//lgr.log(Level.SEVERE, ex.getMessage(), ex);
}
finally
{
try {
if (pst != null)
pst.close();
if (con != null)
con.close();
}
catch (SQLException ex) {
// Logger lgr = Logger.getLogger(HikariCPEx.class.getName());
resul= "<br><br>ERROR: "+ex.getMessage()+"<br><br>";
}
}
return resul;
}
}
|
package net.majorkernelpanic.spydroid.api;
import net.majorkernelpanic.streaming.Session;
import net.majorkernelpanic.streaming.rtsp.RtspServer;
public class CustomRtspServer extends RtspServer {
public CustomRtspServer() {
super();
// RTSP server disabled by default
mEnabled = false;
}
}
|
package ca.csf.dfc.poo.Iterator.classes;
public interface Container {
public Iterator getIterator();
}
|
public class StringToIntegerAtoi {
public int run(String str) {
// 空字符串直接返回
if (str.length() == 0) return 0;
// 过滤空格
int i = 0;
while (i < str.length() && str.charAt(i) == ' ') {
i++;
}
// 是一个空字符串 或 (过滤空格之后)首字母非数字
// > 57 说明也不会是 + - 等符合
if (i >= str.length() || str.charAt(i) > 57) {
return 0;
}
// 判断可能存在的 + - 符合
int num = 0;
boolean flag = true;
if (str.charAt(i) < 48) {
if (str.charAt(i) == '-') {
flag = false;
} else if (str.charAt(i) == '+') {
flag = true;
} else {
return 0;
}
i++;
} else {
num = num * 10 + getNumber((int)str.charAt(i));
i++;
}
// 开始进行转换
while (i < str.length()) {
// 非数字
if (str.charAt(i) > 57 || str.charAt(i) < 48) {
break;
}
// 注意判断越界情况
if (Integer.MAX_VALUE / 10 < num || (Integer.MAX_VALUE / 10 == num && getNumber((int)str.charAt(i)) > 7)) {
if (flag) {
return Integer.MAX_VALUE;
}
return Integer.MIN_VALUE;
}
num = num * 10 + getNumber((int)str.charAt(i));
i++;
}
return flag ? num : -num;
}
/**
* 获取字符对应的整数值
*/
private int getNumber(int num) {
return num - 48;
}
}
|
package mk.petrovski.weathergurumvp.presenter;
import io.reactivex.Observable;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.TestScheduler;
import mk.petrovski.weathergurumvp.TestModels;
import mk.petrovski.weathergurumvp.data.DataManager;
import mk.petrovski.weathergurumvp.data.local.db.CityDetailsModel;
import mk.petrovski.weathergurumvp.data.remote.helper.CompositeDisposableHelper;
import mk.petrovski.weathergurumvp.ui.day_detail.DayDetailMvpView;
import mk.petrovski.weathergurumvp.ui.day_detail.DayDetailPresenter;
import mk.petrovski.weathergurumvp.utils.reactive.TestSchedulerProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.junit.MockitoJUnitRunner;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* Created by Nikola Petrovski on 3/20/2017.
*/
@RunWith(MockitoJUnitRunner.class) public class DayDetailPresenterTest extends
BasePresenterTest<DayDetailPresenter<DayDetailMvpView>, DayDetailMvpView> {
@Override DayDetailPresenter<DayDetailMvpView> createPresenter() {
return new DayDetailPresenter<>(compositeDisposableHelper, dataManager);
}
@Override DayDetailMvpView createView() {
return mock(DayDetailMvpView.class);
}
@Test public void selectCityAsCurrent() {
CityDetailsModel cityDetailsModel = TestModels.newCityModel();
when(dataManager.getSelectedCity()).thenReturn(Observable.just(cityDetailsModel));
presenter.setCurrentCity();
testScheduler.triggerActions();
verify(view).setCurrentCityName(cityDetailsModel.getAreaName());
}
} |
package exer3;
public interface Swimming {
public abstract void swim();
public default void breathe(){
System.out.println("大口呼吸");
}
}
|
package com.eazy.firda.eazy.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
import com.eazy.firda.eazy.R;
import com.eazy.firda.eazy.application.EazyApplication;
import com.eazy.firda.eazy.models.Car;
import java.util.List;
/**
* Created by firda on 3/31/2018.
*/
public class CarImageSlider extends RecyclerView.Adapter<CarImageSlider.MyView> {
ImageLoader imageLoader = EazyApplication.getInstance().getImageLoader();
private List<Car> cars;
private LayoutInflater inflater;
private Context mContext;
public class MyView extends RecyclerView.ViewHolder {
// public ImageView thumbnail;
public NetworkImageView thumbnail;
public String car_id;
public MyView(View view) {
super(view);
thumbnail = view.findViewById(R.id.row_car_img);
}
}
public CarImageSlider(Context context, List<Car> horizontalList) {
this.cars = horizontalList;
mContext = context;
inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public CarImageSlider.MyView onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.ads_row, parent, false);
return new MyView(itemView);
}
@Override
public void onBindViewHolder(CarImageSlider.MyView holder, int position) {
final Car c = cars.get(position);
holder.thumbnail.setImageUrl(c.getCarImage(), imageLoader);
}
@Override
public int getItemCount() {
return cars.size();
}
}
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package resourcemanagementapp.subjects;
import com.jfoenix.controls.JFXComboBox;
import com.jfoenix.controls.JFXRadioButton;
import com.jfoenix.controls.JFXTextField;
import java.io.IOException;
import java.net.URL;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Label;
import javafx.scene.control.Spinner;
import javafx.scene.control.SpinnerValueFactory;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import resourcemanagementapp.database.DBConnection;
/**
* FXML Controller class
*
* @author thilr_88qp6ap
*/
public class AddSubjectController implements Initializable {
@FXML
private AnchorPane addsubjectpane;
@FXML
private JFXComboBox comboOfferedYear;
@FXML
private JFXRadioButton rbtnFirstSem;
@FXML
private ToggleGroup semesterGroup;
@FXML
private JFXRadioButton rbtnSecondSem;
@FXML
private JFXTextField txtSubjectName;
@FXML
private JFXTextField txtSubjectCode;
@FXML
private Spinner spnLectureHours;
@FXML
private Spinner spnTutorialHours;
@FXML
private Spinner spnLabHours;
@FXML
private Spinner spnEvaHours;
@FXML
private Label errLbl;
// DB Connection
Connection connection = DBConnection.DBConnector();
PreparedStatement pst = null;
ResultSet rs = null;
/**
* Initializes the controller class.
* @param url
* @param rb
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// Spinner Value
spinnerValue();
//Radio Button
radioButtonGroup();
// Combo box
showOfferedYear();
}
// Offered year combo box
public void showOfferedYear() {
comboOfferedYear.getItems().clear();
comboOfferedYear.getItems().addAll("1","2","3","4");
}
// Radio button Group
public void radioButtonGroup() {
ToggleGroup semesterGroup = new ToggleGroup();
rbtnFirstSem.setToggleGroup(semesterGroup);
rbtnSecondSem.setToggleGroup(semesterGroup);
}
// Spinner Value factory
public void spinnerValue() {
SpinnerValueFactory<Integer> LHValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 300, 0);
spnLectureHours.setValueFactory(LHValueFactory);
SpinnerValueFactory<Integer> THValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 300, 0);
spnTutorialHours.setValueFactory(THValueFactory);
SpinnerValueFactory<Integer> LaHValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, 300);
spnLabHours.setValueFactory(LaHValueFactory);
SpinnerValueFactory<Integer> EHValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 300, 0);
spnEvaHours.setValueFactory(EHValueFactory);
}
// Load Auto Increment ID
int AID;
public int autoIncrementID() throws SQLException {
String query = "SELECT id FROM subject ORDER BY id DESC LIMIT 1";
pst = (PreparedStatement) connection.prepareStatement(query);
rs = pst.executeQuery();
if(rs.next()) {
AID = rs.getInt("id");
AID = AID + 1;
} else {
AID = 1;
}
System.out.println("Auto Increment ID : " + AID);
rs.close();
pst.close();
return AID;
}
// Validation
public boolean Validation() {
if(comboOfferedYear.getValue() == null) {
errLbl.setText("* Please, choose the offered Year");
return true;
}
if(!(rbtnFirstSem.isSelected() || rbtnSecondSem.isSelected())) {
errLbl.setText("* Please, pick the Semester");
return true;
}
if("".equals(txtSubjectName.getText())) {
errLbl.setText("* Please, fill the Subject Name");
return true;
}
if("".equals(txtSubjectCode.getText())) {
errLbl.setText("* Please, fill the Subject Code");
return true;
}
return false;
}
@FXML
private void backBtnPressed() throws IOException {
// when user clicked Add Lecturer button
this.addsubjectpane.getScene().getWindow().hide();
Parent root = null;
root = FXMLLoader.load(getClass().getResource("ManageSubjects.fxml"));
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.setScene(scene);
stage.setTitle("Manage Subjects - Resouce Management Application");
stage.show();
}
@FXML
private void clearBtnPressed() {
errLbl.setText("");
comboOfferedYear.setValue(null);
rbtnFirstSem.setSelected(false);
rbtnSecondSem.setSelected(false);
txtSubjectName.setText("");
txtSubjectCode.setText("");
spinnerValue();
}
// add subject
String sem;
@FXML
private void saveBtnPressed(ActionEvent event) throws SQLException {
autoIncrementID();
if(Validation() == true) {
System.out.println("== Statement FALSE ==");
} else {
errLbl.setText("");
// Add data to DB
String offered_year = comboOfferedYear.getValue().toString();
if(rbtnFirstSem.isSelected()) {
sem = "1";
} else if(rbtnSecondSem.isSelected()){
sem = "2";
} else {
System.out.println("Please Check Save Button -> Radio Button ");
}
String subject_name = txtSubjectName.getText();
String subject_code = txtSubjectCode.getText();
int lecture_hours = (int) spnLectureHours.getValue();
int tutorial_hours = (int) spnTutorialHours.getValue();
int lab_hours = (int) spnLabHours.getValue();
int eva_hours = (int) spnEvaHours.getValue();
String query = "INSERT INTO subject (id, offered_year, offered_semester, subject_name, subject_code, no_lecture_hours, no_tutorial_hours, no_lab_hours, no_evaluvation_hours) VALUES (?,?,?,?,?,?,?,?,?)";
pst = null;
try {
pst = connection.prepareStatement(query);
pst.setInt(1, AID);
pst.setString(2, offered_year);
pst.setString(3, sem);
pst.setString(4, subject_name);
pst.setString(5, subject_code);
pst.setInt(6, lecture_hours);
pst.setInt(7, tutorial_hours);
pst.setInt(8, lab_hours);
pst.setInt(9, eva_hours);
int connectStatus = pst.executeUpdate();
pst.close();
if(connectStatus == 1) {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
// Get the Stage.
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
// Add a custom icon.
alert.setTitle("Add Subject");
alert.setHeaderText("Successfully Inserted.");
alert.setContentText("ubject Add Successfully");
alert.showAndWait().ifPresent(rs -> {
if (rs == ButtonType.OK)
{
System.out.println("Pressed OK.");
clearBtnPressed();
try {
autoIncrementID();
} catch (SQLException ex) {
Logger.getLogger(AddSubjectController.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
} else {
Alert alert = new Alert(Alert.AlertType.ERROR);
// Get the Stage.
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
// Add a custom icon.
alert.setTitle("Add Lecturer Error");
alert.setHeaderText("Sorry, we can not add subject at this momoment.");
alert.setContentText("Please Try Again Later");
alert.showAndWait().ifPresent(rs -> {
if (rs == ButtonType.OK)
{
System.out.println("Pressed OK.");
}
});
}
} catch(SQLException e) {
System.out.println(e);
}
finally {
pst.close();
}
}
}
}
|
package mouse.shared;
/**
* @author Kevin Streicher <e1025890@student.tuwien.ac.at>
* @param <FirstType>
* @param <SecondType>
*/
public class Pair<FirstType, SecondType> {
public FirstType first;
public SecondType second;
public Pair(FirstType firstElement, SecondType secondElement) {
this.first = firstElement;
this.second = secondElement;
}
}
|
package com.makethingshum.fantasy;
/**
* Created by jwells on 14/02/2017.
*/
public enum Location {
BENTALLS("Bentalls Shopping Centre"),
STPAULS("St. Pauls School Playground"),
RAINFOREST("Rainforest"),
SKATEPARK("Skate Park"),
EMIRATES("Emirates Stadium"),
WHITEHOUSE("The Whitehouse"),
MARS("Planet Mars"),
SPAIN("Spain"),
WEMBLEY("Wembley Stadium"),
PAKISTAN("Pakistan"),
O2("O2 Arena");
private String description;
Location(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
|
package cn.izouxiang.manager.config.web;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import cn.izouxiang.common.config.web.converter.StringToDateConverter;
@Configuration
public class MvcConfigurer extends WebMvcConfigurerAdapter {
@Bean
public StringToDateConverter stringToDateConverter(){
return new StringToDateConverter();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
// registry.addInterceptor(new InitViewInterceptor()).addPathPatterns("/*.html","/");
super.addInterceptors(registry);
}
} |
package com.tencent.mm.plugin.fingerprint.ui;
import com.tencent.mm.ab.l;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.wallet_core.d.g;
import com.tencent.mm.wallet_core.d.i;
class a$1 extends g {
final /* synthetic */ a jhb;
a$1(a aVar, MMActivity mMActivity, i iVar) {
this.jhb = aVar;
super(mMActivity, iVar);
}
public final boolean m(Object... objArr) {
a.a(this.jhb).putString("pwd", (String) objArr[0]);
x.i("MicroMsg.FingerPrintAuthProcess", "this is onNext");
return false;
}
public final boolean d(int i, int i2, String str, l lVar) {
return false;
}
}
|
package com.example.lo52_project;
import java.util.Timer;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.TextView;
/**
* WorldActivity is the abstract class which extends Activity
* SimpleWorldActivity extends WorldActivity
*
* @author Lois Aubree & Lucie Boutou
*/
abstract public class WorldActivity extends Activity implements
OnTouchListener, OnClickListener {
/**
* Delay values used to send messages with correct timing to the NXT robot
*/
public static final int DELAY = 50;
public static final int READ_DELAY = 100;
public static final int SONAR_DELAY = 500;
public static final int TURN_HEAD_DELAY = 1000;
public static final int TURN_ROBOT_DELAY = 2000;
protected Timer mTimer = new Timer();
protected Robot mRobot;
/**
* The application switches between 4 modes
*/
protected MenuItem mSlaveMode;
protected MenuItem mConnectedMode;
protected MenuItem mMissionMode;
protected MenuItem mVirtualMode;
protected Menu mMenu;
/**
* Objects allowing the user to communicate with the application
*/
protected ImageButton mSlaveButton_left;
protected ImageButton mSlaveButton_right;
protected ImageButton mSlaveButton_forward;
protected ImageButton mSlaveButton_backward;
protected ImageButton mSlaveButton_left_head;
protected ImageButton mSlaveButton_right_head;
protected ImageButton mSlaveButton_light;
protected ImageButton mSlaveButton_ultrasonic;
protected ImageButton mSlaveButton_center;
protected TextView lightTextView;
protected TextView sonarTextView;
/**
* Objects allowing the user to run the NXT robot in connected mode
*/
protected Button mRunButton;
protected enum SelectedMode {
MODE_SLAVE, MODE_CONNECTED, MODE_MISSION, MODE_VIRTUAL
};
protected SelectedMode mCurrentMode;
protected BluetoothThread mBluetoothThread = null;
protected BluetoothAdapter mBluetoothAdapter = null;
protected BluetoothDevice mDevice = null;
protected String NXT_MAC_ADDRESS;
protected String NXT_NAME;
protected static final int REQUEST_ENABLE_BT = 1;
protected static final int REQUEST_GET_DEVICE = 2;
protected static final String NXT_EXTRA_NAME = "nxt_name";
protected static final String NXT_EXTRA_ADD = "nxt_address";
protected FrameLayout mMainLayout;
protected View mSlaveLayout;
protected View mConnectedLayout;
protected boolean IS_NXT_CONNECTED = false;
protected Handler mBTHandler;
/**
* This Handler handles messages from the bluetooth thread and updates the
* variable of the robot object
*/
protected Handler mActHandler = new Handler() {
@Override
public void handleMessage(Message message) {
switch (message.getData().getInt("task")) {
case BluetoothThread.RETURN_SENSOR_VALUE:
if (message.getData().getInt("device") == BluetoothThread.LIGHT_SENSOR)
mRobot.setLightValue(message.getData().getInt("param1"));
break;
case BluetoothThread.RETURN_I2C_SENSOR_VALUE:
if (message.getData().getInt("device") == BluetoothThread.ULTRASONIC_SENSOR)
mRobot.setSonarValue(message.getData().getInt("param1"));
break;
case BluetoothThread.RETURN_MOTOR_STATE:
if (message.getData().getInt("device") == BluetoothThread.MOTOR_A)
mRobot.setMotorATacho(message.getData().getInt("param1"));
break;
default:
break;
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (!mBluetoothAdapter.isEnabled()) {
Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(intent, REQUEST_ENABLE_BT);
} else
setBluetooth();
mSlaveLayout = (View) getLayoutInflater().inflate(
R.layout.slave_layout, null);
mConnectedLayout = (View) getLayoutInflater().inflate(
R.layout.connected_layout, null);
/**
* Buttons images
*/
mSlaveButton_left = (ImageButton) mSlaveLayout
.findViewById(R.id.button_left);
mSlaveButton_right = (ImageButton) mSlaveLayout
.findViewById(R.id.button_right);
mSlaveButton_forward = (ImageButton) mSlaveLayout
.findViewById(R.id.button_forward);
mSlaveButton_backward = (ImageButton) mSlaveLayout
.findViewById(R.id.button_backward);
mSlaveButton_left_head = (ImageButton) mSlaveLayout
.findViewById(R.id.button_left_head);
mSlaveButton_right_head = (ImageButton) mSlaveLayout
.findViewById(R.id.button_right_head);
mSlaveButton_light = (ImageButton) mSlaveLayout
.findViewById(R.id.button_light);
mSlaveButton_ultrasonic = (ImageButton) mSlaveLayout
.findViewById(R.id.button_ultrasonic);
mSlaveButton_center = (ImageButton) mSlaveLayout
.findViewById(R.id.button_center);
sonarTextView = (TextView) mSlaveLayout.findViewById(R.id.sensorText);
lightTextView = (TextView) mSlaveLayout.findViewById(R.id.lightText);
/**
* Add of the OnTouch listener to the different buttons
*/
mSlaveButton_left.setOnTouchListener(this);
mSlaveButton_right.setOnTouchListener(this);
mSlaveButton_forward.setOnTouchListener(this);
mSlaveButton_backward.setOnTouchListener(this);
mSlaveButton_left_head.setOnTouchListener(this);
mSlaveButton_right_head.setOnTouchListener(this);
mSlaveButton_light.setOnTouchListener(this);
mSlaveButton_ultrasonic.setOnTouchListener(this);
mSlaveButton_center.setOnTouchListener(this);
mRobot = new Robot();
};
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main_menu, menu);
mMenu = menu;
return true;
}
/**
* Display the layout of selected mode
*/
public boolean onOptionsItemSelected(MenuItem item) {
if (item.isChecked())
item.setChecked(false);
else
item.setChecked(true);
switch (item.getItemId()) {
case R.id.SlaveModeItem:
if (mCurrentMode != SelectedMode.MODE_SLAVE) {
mMainLayout.removeView(mConnectedLayout);
mMainLayout.addView(mSlaveLayout);
mCurrentMode = SelectedMode.MODE_SLAVE;
}
break;
case R.id.ConnectedModeItem:
if (mCurrentMode != SelectedMode.MODE_CONNECTED) {
mMainLayout.removeView(mSlaveLayout);
mMainLayout.addView(mConnectedLayout);
mRunButton = (Button) findViewById(R.id.start_connected);
mRunButton.setOnClickListener(this);
mCurrentMode = SelectedMode.MODE_CONNECTED;
}
break;
case R.id.MissionModeItem:
if (mCurrentMode != SelectedMode.MODE_MISSION) {
mMainLayout.removeView(mSlaveLayout);
mMainLayout.removeView(mConnectedLayout);
mCurrentMode = SelectedMode.MODE_MISSION;
}
break;
case R.id.VirtualModeItem:
if (mCurrentMode != SelectedMode.MODE_VIRTUAL) {
mMainLayout.removeView(mSlaveLayout);
mMainLayout.removeView(mConnectedLayout);
mCurrentMode = SelectedMode.MODE_VIRTUAL;
}
break;
}
return super.onOptionsItemSelected(item);
}
/**
* Create the connection using the name and MAC address returned by the
* ListBluetoothActivity
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_ENABLE_BT && resultCode == RESULT_OK)
setBluetooth();
if (requestCode == REQUEST_GET_DEVICE && resultCode == RESULT_OK) {
Bundle bdle = data.getExtras();
NXT_NAME = bdle.getString(NXT_EXTRA_NAME);
NXT_MAC_ADDRESS = bdle.getString(NXT_EXTRA_ADD);
mBluetoothAdapter.cancelDiscovery();
mDevice = mBluetoothAdapter.getRemoteDevice(NXT_MAC_ADDRESS);
mBluetoothThread = new BluetoothThread(true, mBluetoothAdapter,
mDevice, mActHandler);
mBTHandler = mBluetoothThread.getHandler();
mBluetoothThread.init();
mBluetoothThread.start();
/**
* Initialization of the sensors as soon as the bluetooth connection
* is on
*/
sendBTmessage(BluetoothThread.INITIALIZE_SENSOR,
BluetoothThread.LIGHT_SENSOR, 0, 0);
sendBTmessage(BluetoothThread.INITIALIZE_SENSOR,
BluetoothThread.ULTRASONIC_SENSOR, 0, 0);
sendBTmessage(BluetoothThread.ASK_I2C_SENSOR_VALUE,
BluetoothThread.ULTRASONIC_SENSOR, 0, 0);
sendBTmessage(BluetoothThread.ASK_SENSOR_VALUE,
BluetoothThread.LIGHT_SENSOR, 0, 0);
}
if (requestCode == REQUEST_ENABLE_BT && resultCode == RESULT_CANCELED) {
mMenu.findItem(R.id.SlaveModeItem).setEnabled(false);
mMenu.findItem(R.id.ConnectedModeItem).setEnabled(false);
mMenu.findItem(R.id.MissionModeItem).setEnabled(false);
}
if (requestCode == REQUEST_GET_DEVICE && resultCode == RESULT_CANCELED) {
mMenu.findItem(R.id.SlaveModeItem).setEnabled(false);
mMenu.findItem(R.id.ConnectedModeItem).setEnabled(false);
mMenu.findItem(R.id.MissionModeItem).setEnabled(false);
}
};
protected void setBluetooth() {
mBluetoothAdapter.startDiscovery();
Intent intent = new Intent(this, ListBluetoothActivity.class);
startActivityForResult(intent, REQUEST_GET_DEVICE);
}
/**
* sends the message to the Handler of the bluetooth thread
*
* @param task
* code
* @param device
* code (motor or sensor)
* @param value1
* @param value2
*/
public void sendBTmessage(int task, int device, int param1, int param2) {
Bundle bundle = new Bundle();
bundle.putInt("task", task);
bundle.putInt("device", device);
bundle.putInt("param1", param1);
bundle.putInt("param2", param2);
Message message = mActHandler.obtainMessage();
message.setData(bundle);
mBTHandler.sendMessage(message);
}
}
|
// Generated from C:\Users\User\Dropbox\Federal\MESTRADO\Projeto\workspace\ProjetoFinal\src\gramaticas\preProcessor\GramaticaPreProcessor.g4 by ANTLR 4.0
package gramaticas.preProcessor;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.TerminalNode;
import org.antlr.v4.runtime.tree.ErrorNode;
public class GramaticaPreProcessorBaseListener implements GramaticaPreProcessorListener {
@Override public void enterPeriodo(GramaticaPreProcessorParser.PeriodoContext ctx) { }
@Override public void exitPeriodo(GramaticaPreProcessorParser.PeriodoContext ctx) { }
@Override public void enterEveryRule(ParserRuleContext ctx) { }
@Override public void exitEveryRule(ParserRuleContext ctx) { }
@Override public void visitTerminal(TerminalNode node) { }
@Override public void visitErrorNode(ErrorNode node) { }
} |
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2015 Paco Avila & Josep Llort
*
* No bytes were intentionally harmed during the development of this application.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.openkm.util;
import com.openkm.core.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public class ThreadPoolManager {
private static Logger log = LoggerFactory.getLogger(ThreadPoolManager.class);
private static final int POOL_TIMEOUT = 1;
private static final int MAX_TIMEOUTS = 10;
private static List<ThreadPoolManager> createdManagers = new ArrayList<ThreadPoolManager>();
private ExecutorService executor;
private String name;
/**
* Create new thread pool manage.
*/
public ThreadPoolManager() {
this.executor = Executors.newFixedThreadPool(Config.AVAILABLE_PROCESSORS);
this.name = Integer.toHexString(hashCode());
createdManagers.add(this);
}
/**
* Create new thread pool manage.
*
* @param nThreads Number of concurrent threads.
*/
public ThreadPoolManager(int nThreads) {
this.executor = Executors.newFixedThreadPool(nThreads);
this.name = Integer.toHexString(hashCode());
createdManagers.add(this);
}
/**
* Create new thread pool manage.
*
* @param nThreads Number of concurrent threads.
* @param name Name of the thread pool.
*/
public ThreadPoolManager(int nThreads, String name) {
this.executor = Executors.newFixedThreadPool(nThreads);
this.name = name;
createdManagers.add(this);
}
/**
* Add a new thread to the manager.
*
* @param runnable The Runnable task to add.
*/
public synchronized void add(Runnable runnable) {
executor.execute(runnable);
}
/**
* Shutdown pool manager.
*/
public void shutdown() {
shutdown(false);
}
/**
* Shutdown pool manager.
*
* @param now If the shutdown should be right now or can wait until all thread have finished.
*/
public synchronized void shutdown(boolean now) {
if (now) {
executor.shutdownNow();
} else {
executor.shutdown();
}
log.info("### {}: All threads shutdown requested ###", name);
try {
for (int i = 0; !executor.awaitTermination(POOL_TIMEOUT, TimeUnit.MINUTES); i++) {
if (i > MAX_TIMEOUTS) {
log.info("### {}: Killing never ending tasks... ({}) ###", name, i);
executor.shutdownNow();
} else {
log.info("### {}: Awaiting for pool tasks termination... ({}) ###", name, i);
}
}
} catch (InterruptedException e) {
log.warn("### {}: Exception awaiting for pool tasks termination: {} ###", name, e.getMessage());
}
createdManagers.remove(this);
log.info("### {}: All threads have finished ###", name);
}
/**
* Shutdown all created poll managers.
*/
public static void shutdownAll() {
shutdownAll(false);
}
/**
* Shutdown all created poll managers.
*
* @param now If the shutdown should be right now or can wait until all thread have finished.
*/
public static synchronized void shutdownAll(boolean now) {
for (Iterator<ThreadPoolManager> it = createdManagers.iterator(); it.hasNext(); ) {
ThreadPoolManager tpm = it.next();
tpm.shutdown(now);
it.remove();
log.info("{}: Removed from list", tpm.name);
}
}
}
|
package Info;
public class samsongSchoolBusTime {
String text;
void samsongTime(int hour, int minute) {
if(hour==8) { // 8시
if(minute>=10 && minute<20) { // 8:20
text = "삼송 셔틀이 " + hour + "시 20분에 있습니다.";
}
else if(minute>=20 && minute<30) { // 8:30
text = "삼송 셔틀이 " + hour + "시 30분에 있습니다.";
}
}
if(hour==9) { // 9시
if(minute>=0 && minute<10) { // 9:10
text = "삼송 셔틀이 " + hour + "시 10분에 있습니다.";
}
else if(minute>=10 && minute<20) { // 9:20
text = "삼송 셔틀이 " + hour + "시 20분에 있습니다.";
}
else if(minute>=20 && minute<30) { // 9:30
text = "삼송 셔틀이 " + hour + "시 30분에 있습니다.";
}
}
if(hour==10) { // 10시
if(minute>=0 && minute<10) { // 10:10
text = "삼송 셔틀이 " + hour + "시 10분에 있습니다.";
}
else if(minute>=10 && minute<20) { // 10:20
text = "삼송 셔틀이 " + hour + "시 20분에 있습니다.";
}
}
if(hour==11) { // 11시
if(minute>=10 && minute<20) { // 11:20
text = "삼송 셔틀이 " + hour + "시 20분에 있습니다.";
}
}
if(hour==12) { // 12시
if(minute>=10 && minute<20) { // 12:20
text = "삼송 셔틀이 " + hour + "시 20분에 있습니다.";
}
}
if(hour==13) { // 1시
if(minute>=10 && minute<20) { // 1:20
text = "삼송 셔틀이 " + hour + "시 20분에 있습니다.";
}
}
if(hour==14) { // 2시
if(minute>=10 && minute<20) { // 2:20
text = "삼송 셔틀이 " + hour + "시 40분에 있습니다.";
}
}
if(hour==15) { // 3시
if(minute>=10 && minute<20) { // 3:20
text = "삼송 셔틀이 " + hour + "시 40분에 있습니다.";
}
}
}
}
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package eje2;
import javax.swing.JOptionPane;
/**
*
* @author Mery Acevedo
*/
public class eje2Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Producto p=new Producto();//fecha de caducidad,,,,,//fecha actual
p.verificarCaducidad(2012, 10, 5, 2012, 10, 6);
JOptionPane.showMessageDialog(null,"impuesto: "+String.valueOf(p.generarImpuesto(p.pedirPrecio())));
JOptionPane.showMessageDialog(null,"precio total: "+p.precioTotal());
}
}
|
package com.unistudents.api.service.impl;
import com.unistudents.api.model.Grades;
import com.unistudents.api.parser.StudentsParser;
import com.unistudents.api.scraper.StudentsScraper;
import com.unistudents.api.service.GradesService;
import org.jsoup.nodes.Document;
import org.springframework.stereotype.Service;
@Service
public class GradesServiceImpl implements GradesService {
@Override
public Grades getGrades(String username, String password) {
// scrap grades page
StudentsScraper scraper = new StudentsScraper(username, password);
// authorized check
if (!scraper.isAuthorized()) {
return null;
}
Document gradesPage = scraper.getGradesPage();
// return object
StudentsParser parser = new StudentsParser();
return parser.parseGradesPage(gradesPage);
}
}
|
package com.tencent.mm.plugin.wallet.balance.ui.lqt;
import com.tencent.mm.protocal.c.pk;
import com.tencent.mm.vending.c.a;
class WalletLqtDetailUI$6 implements a<Void, pk> {
final /* synthetic */ WalletLqtDetailUI pbs;
WalletLqtDetailUI$6(WalletLqtDetailUI walletLqtDetailUI) {
this.pbs = walletLqtDetailUI;
}
public final /* synthetic */ Object call(Object obj) {
WalletLqtDetailUI.h(this.pbs).postDelayed(new 1(this), 1000);
return uQG;
}
}
|
package zm.gov.moh.common.submodule.form.model.widgetModel;
import java.util.List;
public interface WidgetGroupModel extends WidgetModel {
void addChild(WidgetModel widgetModel);
void addChildren(List<WidgetModel> components);
WidgetModel getChild(int index);
List<WidgetModel> getChildren();
void setTitle(String title);
String getTitle();
} |
package removeDuplicates;
import java.util.Hashtable;
import java.util.LinkedList;
public class removeDuplicates{
public void removeDuplicates(LinkedListNode n){
Hashtable table = new Hashtable();
LinkedListNode pre = null;
while(n!=null){
if(table.contains(n.data)){
pre.next = n.next;
}
else{
table.put(n.data, true);
}
pre = n;
n = n.next;
}
}
public void removeDuplicatesNobuffer(LinkedListNode head){
if(head == null){
return;
}
LinkedListNode node = head;
while(head!=null){
while(node!=null){
if(node.next.data == head.data){
node.next = node.next.next;
}
node = node.next;
}
head = head.next;
}
}
} |
package org.xgame.global.system;
/**
* @Name: SystemStateEnum.class
* @Description: // 系统状态枚举
* @Create: DerekWu on 2018/9/2 18:00
* @Version: V1.0
*/
public enum SystemStateEnum {
// STOP, // 停止状态
STARTING, // 启动中
RUNNING, // 运行中
STOPPING // 停止中,停止有一个过程
}
|
//package com.alodiga.wallet.ejb;
//
//import java.util.List;
//
//import javax.ejb.Stateless;
//import javax.ejb.TransactionManagement;
//import javax.ejb.TransactionManagementType;
//import javax.interceptor.Interceptors;
//
//import org.apache.log4j.Logger;
//import com.alodiga.wallet.common.ejb.BusinessEJB;
//import com.alodiga.wallet.common.genericEJB.WalletContextInterceptor;
//import com.alodiga.wallet.common.genericEJB.WalletLoggerInterceptor;
//import com.alodiga.wallet.common.utils.EjbConstants;
//import com.portal.business.commons.data.BusinessData;
//import com.portal.business.commons.exceptions.EmptyListException;
//import com.portal.business.commons.exceptions.GeneralException;
//import com.portal.business.commons.exceptions.NullParameterException;
//import com.portal.business.commons.models.Business;
//
//@Interceptors({WalletLoggerInterceptor.class, WalletContextInterceptor.class})
//@Stateless(name = EjbConstants.BUSINESS_EJB, mappedName = EjbConstants.BUSINESS_EJB)
//@TransactionManagement(TransactionManagementType.BEAN)
//public class BusinessEJBImp implements BusinessEJB {
//
// private static final Logger logger = Logger.getLogger(BusinessEJBImp.class);
//
// private BusinessData businessData = new BusinessData();
//
// public Business getBusinessById(long id) throws NullParameterException, GeneralException {
// return businessData.getBusinessById(id);
// }
//
// public Business getBusinessByCode(String code) throws NullParameterException, GeneralException {
// return businessData.getBusinessByCode(code);
// }
//
// public Business getBusinessByIdentification(String identification) throws NullParameterException, GeneralException {
// return businessData.getBusinessByIdentification(identification);
// }
//
// public Business getBusinessByEmail(String email) throws NullParameterException, GeneralException {
// return businessData.getBusinessByEmail(email);
// }
//
// public Business getBusinessByPhone(String phone) throws NullParameterException, GeneralException {
// return businessData.getBusinessByPhone(phone);
// }
//
// public Business getBusinessByLogin(String login) throws NullParameterException, GeneralException {
// return businessData.getBusinessByLogin(login);
// }
//
// public List<Business> getAll() throws EmptyListException, GeneralException {
// return businessData.getBusinessList();
// }
//}
|
package interviewbit.math;
public class Verify_Prime {
public int isPrime(int a) {
if(a<2)
return 0;
for (int i = 2; i <= Math.sqrt(a); i++) {
if (a % i == 0) {
return 0;
}
}
return 1;
}
}
|
package com.tencent.mm.plugin.boots.a;
public interface d {
}
|
package com.mic.luxemain.service;
import com.mic.luxemain.Repository.DailyMealRepository;
import com.mic.luxemain.Repository.MenuItemRepository;
import com.mic.luxemain.domain.DailyMeal;
import com.mic.luxemain.domain.MenuItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
@Service
public class DailyMealService {
@Autowired
DailyMealRepository repository;
@Autowired
MenuItemRepository menuItemRepository;
public boolean updateDailyMeal(Long id , DailyMeal meal){
Optional<DailyMeal> repositoryById = repository.findById(id);
if(repositoryById.isPresent()){
repositoryById.get().setDay(meal.getDay());
repositoryById.get().setSpecialPrice(meal.getSpecialPrice());
}
else
return false;
repository.save(repositoryById.get());
return true;
}
public boolean addNewSpecial(long itemId){
DailyMeal meal = null ;
Optional<MenuItem> menuItem = menuItemRepository.findById(itemId);
meal = new DailyMeal("may 21 , 1958" , 5 , menuItem.get());
repository.save(meal);
return true;
}
//this gets al the daily specical for the current if it is in the list of daily special set for today
public Iterable<DailyMeal> findByCurrentDay(){
Iterable<DailyMeal> allDailyMeal = repository.findAll();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String currentDay = formatter.format(LocalDate.now());
List<DailyMeal> todaySpecial = new LinkedList<>();
for (DailyMeal m : allDailyMeal){
if (currentDay.equals(m.getDay())){
todaySpecial.add(m);
}
}
Iterable<DailyMeal> todaysMeal = todaySpecial;
return todaysMeal;
}
}
|
public class HelloWorldExternalC
{
public void HelloWorldC()
{
System.out.println("HelloWorldC");
}
}
|
//---------------------------------FTPServer---------------------------------------------
//
// This first function goal is to launch the ftp server (in his globality).
// It creates the virtual files asked and allows us to launch a fixed
// number of threads when the program is called.
//
//Copyright (c) 2019 by Thomas BASTIN & Victor Dachet. All Rights Reserved.
//-----------------------------------------------------------------------------------------
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.net.*;
public class FTPServer{
public static void main(String[] args){
// Firstly we take as an argument the Maxthreadpool
int maxThread = 1 ;// We initiate is value to one
// We effectuate this into a try and catch in the case that args cannot be parse correctly
try{
maxThread = Integer.parseInt(args[0]);
}catch(NumberFormatException e){
System.out.println("We couldn't parse correctly the maxThreads number ! ");
}// end try&catch
// We fix the number thread pool
ExecutorService exe = Executors.newFixedThreadPool(maxThread);
// Instantiation of virtual file
FileVirtuel file_virtuel = new FileVirtuel();
try{
// We create a ServerSocket with port 21xx for the connection
ServerSocket commandSocket = new ServerSocket(2106);
commandSocket.setSoTimeout(1000000);
Socket managementCommandSocket = null;
while(true){
// We accpet the ServerSocket
managementCommandSocket = commandSocket.accept();
managementCommandSocket.setSoTimeout(300000); // timeout define to wait x second , if it is reach the Socket closed
// We launch a new thread
System.out.println("New connection incoming");
exe.execute(new Management(managementCommandSocket, file_virtuel));
}// end while
}catch(IOException e){
System.out.println(e.getMessage());
}// end try&catch
exe.shutdown();
}//end main function
}// end class
|
package com.zhouyi.business.controller;
import com.zhouyi.business.core.common.ReturnCode;
import com.zhouyi.business.core.model.ReportDto;
import com.zhouyi.business.core.model.Response;
import com.zhouyi.business.core.model.cmodes.ReportCondition;
import com.zhouyi.business.core.service.ReportService;
import com.zhouyi.business.core.utils.MapUtils;
import com.zhouyi.business.core.utils.ResponseUtil;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author 李秸康
* @ClassNmae: ReportController
* @Description: TODO 报表控制器
* @date 2019/9/3 15:14
* @Version 1.0
**/
@RestController
@RequestMapping(value = "/api/report")
public class ReportController {
@Autowired
private ReportService reportService;
/**
* 导出报表数据
* @param reportCondition
* @return
*/
@ApiOperation(value = "查询报表")
@RequestMapping(value = "",method = RequestMethod.POST)
public Response<List<ReportDto>> report(@RequestBody ReportCondition reportCondition){
Map<String,Object> conditions= MapUtils.objectTransferToMap(reportCondition);
List<ReportDto> reportDtos = reportService.listReportInfos(conditions);
return ResponseUtil.getResponseInfo(ReturnCode.SUCCESS,reportDtos);
}
/**
* 导出报表数据
* @param reportCondition
*/
@RequestMapping(value = "/export",method = RequestMethod.POST)
public String export(@RequestBody ReportCondition reportCondition, HttpServletResponse response){
Map<String,Object> conditions=MapUtils.objectTransferToMap(reportCondition);
ServletOutputStream outputStream=null;
try {
HSSFWorkbook workbook = reportService.generateWorkBookInfo(conditions);
outputStream=response.getOutputStream();
response.reset();
response.setHeader("Content-Type","application/octet-stream");
response.setHeader("Content-Disposition","attachment;filename=details.xls");
workbook.write(outputStream);
} catch (IOException e) {
e.printStackTrace();
}finally {
if(outputStream!=null){
try {
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return null;
}
}
|
/**
*
*/
package com.cnk.travelogix.supplier.commercials.core.service.impl;
import de.hybris.platform.catalog.enums.ArticleApprovalStatus;
import de.hybris.platform.servicelayer.model.ModelService;
import java.util.Date;
import com.cnk.travelogix.supplier.commercials.core.advanced.incentiveontopup.model.SupplierIncentiveOnTopupRecordModel;
import com.cnk.travelogix.supplier.commercials.core.advanced.looktobook.model.SupplierLookToBookCommercialRecordModel;
import com.cnk.travelogix.supplier.commercials.core.advanced.msf.model.SupplierMSFFeeRecordModel;
import com.cnk.travelogix.supplier.commercials.core.advanced.otherfee.model.SupplierOtherFeeCommercialRecordModel;
import com.cnk.travelogix.supplier.commercials.core.advanced.penalty.model.SupplierPenaltyKickBackCommercialRecordModel;
import com.cnk.travelogix.supplier.commercials.core.advanced.signupbonus.model.SupplierSignUpBonusCommercialRecordModel;
import com.cnk.travelogix.supplier.commercials.core.advanced.termination.model.SupplierTerminationFeeCommercialRecordModel;
import com.cnk.travelogix.supplier.commercials.core.dao.SupplierCommercialHeadsDao;
import com.cnk.travelogix.supplier.commercials.core.service.SupplierCommercialHeadsService;
/**
*
*/
public class DefaultSupplierCommercialHeadsService implements SupplierCommercialHeadsService
{
private ModelService modelService;
private SupplierCommercialHeadsDao supplierCommercialHeadsDao;
/*
* (non-Javadoc)
*
* @see
* com.cnk.travelogix.supplier.commercials.core.service.SupplierCommercialHeadsService#changeCommercialHeadsStatus()
*/
@Override
public void changeCommercialHeadsStatus()
{
for (final SupplierSignUpBonusCommercialRecordModel signupBonus : supplierCommercialHeadsDao.getSignupBonusCommercials())
{
if (signupBonus.getValidTo().compareTo(new Date()) <= 0)
{
signupBonus.setApprovalStatus(ArticleApprovalStatus.UNAPPROVED);
}
modelService.save(signupBonus);
}
for (final SupplierIncentiveOnTopupRecordModel incentiveTopup : supplierCommercialHeadsDao.getIncentiveOnTopup())
{
if (incentiveTopup.getValidTo().compareTo(new Date()) <= 0)
{
incentiveTopup.setApprovalStatus(ArticleApprovalStatus.UNAPPROVED);
}
modelService.save(incentiveTopup);
}
for (final SupplierLookToBookCommercialRecordModel lookToBook : supplierCommercialHeadsDao.getLookToBookCommercials())
{
if (lookToBook.getValidTo().compareTo(new Date()) <= 0)
{
lookToBook.setApprovalStatus(ArticleApprovalStatus.UNAPPROVED);
}
modelService.save(lookToBook);
}
for (final SupplierMSFFeeRecordModel msfFee : supplierCommercialHeadsDao.getMsfFees())
{
if (msfFee.getValidTo().compareTo(new Date()) <= 0)
{
msfFee.setApprovalStatus(ArticleApprovalStatus.UNAPPROVED);
}
modelService.save(msfFee);
}
for (final SupplierOtherFeeCommercialRecordModel otherFee : supplierCommercialHeadsDao.getOtherFeeCommercials())
{
if (otherFee.getValidTo().compareTo(new Date()) <= 0)
{
otherFee.setApprovalStatus(ArticleApprovalStatus.UNAPPROVED);
}
modelService.save(otherFee);
}
for (final SupplierPenaltyKickBackCommercialRecordModel penaltyKickback : supplierCommercialHeadsDao
.getPenaltyKickbackCommercials())
{
if (penaltyKickback.getValidTo().compareTo(new Date()) <= 0)
{
penaltyKickback.setApprovalStatus(ArticleApprovalStatus.UNAPPROVED);
}
modelService.save(penaltyKickback);
}
for (final SupplierTerminationFeeCommercialRecordModel terminationFee : supplierCommercialHeadsDao
.getTerminationFeeCommercials())
{
if (terminationFee.getValidTo().compareTo(new Date()) <= 0)
{
terminationFee.setApprovalStatus(ArticleApprovalStatus.UNAPPROVED);
}
modelService.save(terminationFee);
}
}
/**
* @return the modelService
*/
public ModelService getModelService()
{
return modelService;
}
/**
* @param modelService
* the modelService to set
*/
public void setModelService(final ModelService modelService)
{
this.modelService = modelService;
}
/**
* @return the supplierCommercialHeadsDao
*/
public SupplierCommercialHeadsDao getSupplierCommercialHeadsDao()
{
return supplierCommercialHeadsDao;
}
/**
* @param supplierCommercialHeadsDao
* the supplierCommercialHeadsDao to set
*/
public void setSupplierCommercialHeadsDao(final SupplierCommercialHeadsDao supplierCommercialHeadsDao)
{
this.supplierCommercialHeadsDao = supplierCommercialHeadsDao;
}
}
|
public class Student {
private int id;
private String firstName;
private String gender;
private String gpa;
private String email;
public Student(int id, String first_name, String gpa, String gender, String email) {
this.id = id;
this.firstName = first_name;
this.gpa = gpa;
this.gender = gender;
this.email = email;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getGpa() {
return gpa;
}
public void setGpa(String gpa) {
this.gpa = gpa;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "Student{" +
"id=" + id +
", first_name='" + firstName + '\'' +
", gpa='" + gpa + '\'' +
", gender='" + gender + '\'' +
", email='" + email + '\'' +
'}'+"\n";
}
}
|
package com.tencent.mm.plugin.aa.ui;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import com.tencent.mm.bg.d;
import com.tencent.mm.model.q;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.protocal.c.k;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.x;
class AAQueryListUI$3 implements OnItemClickListener {
final /* synthetic */ AAQueryListUI eCd;
AAQueryListUI$3(AAQueryListUI aAQueryListUI) {
this.eCd = aAQueryListUI;
}
public final void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
if (AAQueryListUI.f(this.eCd) != null) {
if (i < 0 || i >= AAQueryListUI.f(this.eCd).getCount()) {
x.i("MicroMsg.AAQueryListUI", "click out of bound! %s", Integer.valueOf(i));
return;
}
int top = view.getTop();
k kVar = (k) AAQueryListUI.f(this.eCd).getItem(i);
if (kVar != null) {
if (!bi.oW(kVar.qYo)) {
Intent intent = new Intent();
intent.putExtra("rawUrl", kVar.qYo);
d.b(this.eCd, "webview", ".ui.tools.WebViewUI", intent);
} else if (!bi.oW(kVar.qYc)) {
String str = null;
if (kVar.qYn == 2) {
str = q.GF();
}
Intent intent2 = new Intent(this.eCd, PaylistAAUI.class);
intent2.putExtra("bill_no", kVar.qYc);
intent2.putExtra("launcher_user_name", str);
intent2.putExtra("enter_scene", 4);
intent2.putExtra("chatroom", kVar.qYd);
intent2.putExtra("item_position", i);
intent2.putExtra("item_offset", top);
this.eCd.startActivityForResult(intent2, 1);
}
}
}
h.mEJ.h(13721, Integer.valueOf(5), Integer.valueOf(3));
}
}
|
package ufc.br.so.programs;
import java.util.List;
import ufc.br.so.memory.Page;
import ufc.br.so.services.ServicesRunning;
public class GetDateTime extends Program {
public GetDateTime() {
this.setName("getdatetime");
this.setSize(4);
this.setDescription("getdatetime - Return the current date and time");
}
@Override
public void execute() {
List<Page> busyPages = this.setBusyPages();
ServicesRunning.getServiceRunning("getdatetime").execute();
freePages(busyPages);
}
}
|
package io.bega.kduino.datamodel;
import com.google.gson.annotations.SerializedName;
/**
* Created by usuario on 01/09/15.
*/
public class UserRecievedDefinition {
@SerializedName("user_id")
public String UserID;
@SerializedName("username")
public String UserName;
@SerializedName("name")
public String Name;
@SerializedName("country")
public String Country;
@SerializedName("email")
public String Email;
public UserRecievedDefinition()
{
}
}
|
package com.example.springboothibernate.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.example.springboothibernate.models.Course;
import com.example.springboothibernate.service.StudentCourseService;
@RestController
public class StudentCourseController {
@Autowired
private StudentCourseService studentCourseService;
@GetMapping("/processData")
public void processData() {
studentCourseService.processData();
}
@GetMapping("/courses")
public List<Course> getCourses(){
return studentCourseService.findAll();
}
}
|
package dto.main;
public class Respuesta<T> {
private int codigoHttp;
private T cuerpo;
private String mensaje;
public Respuesta(int codigoHttp, T cuerpo, String mensaje) {
super();
this.codigoHttp = codigoHttp;
this.cuerpo = cuerpo;
this.mensaje = mensaje;
}
public Respuesta() {
super();
}
public int getCodigoHttp() {
return codigoHttp;
}
public void setCodigoHttp(int codigoHttp) {
this.codigoHttp = codigoHttp;
}
public T getCuerpo() {
return cuerpo;
}
public void setCuerpo(T cuerpo) {
this.cuerpo = cuerpo;
}
public String getMensaje() {
return mensaje;
}
public void setMensaje(String mensaje) {
this.mensaje = mensaje;
}
}
|
package com.geektech.todo;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class TaskViewHolder extends RecyclerView.ViewHolder {
TextView title;
TextView description;
TextView deadline;
public TaskViewHolder(@NonNull View itemView) {
super(itemView);
title = itemView.findViewById(R.id.vh_title);
description = itemView.findViewById(R.id.vh_description);
deadline = itemView.findViewById(R.id.vh_deadline);
}
public void onBind(Task task) {
title.setText(task.title);
description.setText(task.description);
deadline.setText(task.deadline);
}
}
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.book.mycdi.interceptor;
import com.book.mycdi.model.Dog;
import javax.inject.Inject;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
/**
*
* @author avbravo
*/
@Feed
@Interceptor
public class FeedInterceptor {
@Inject
Dog dog;
@AroundInvoke
public Object authorize(InvocationContext ic) throws Exception {
try {
if (!dog.getHunger()) {
return ic.proceed();
} else {
throw new Exception();
}
} catch (Exception e) {
throw e;
}
}
}
|
package com.example.healthmanage.ui.activity.qualification;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.healthmanage.BR;
import com.example.healthmanage.R;
import com.example.healthmanage.base.BaseActivity;
import com.example.healthmanage.databinding.ActivityHospitalBinding;
import com.example.healthmanage.ui.activity.qualification.adapter.HospitalAdapter;
import com.example.healthmanage.ui.activity.qualification.response.HospitalResponse;
import java.util.ArrayList;
import java.util.List;
/**
* 选择医院
*/
public class SelectHospitalActivity extends BaseActivity<ActivityHospitalBinding,DepartMentViewModel> {
private HospitalAdapter hospitalAdapter;
private List<HospitalResponse.DataBean> hospitalList;
@Override
protected void initData() {
initView();
viewModel.getHospitalByName("");
}
private void initView() {
hospitalList = new ArrayList<>();
dataBinding.recyclerViewHospital.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
dataBinding.recyclerViewHospital.addItemDecoration(new DividerItemDecoration(SelectHospitalActivity.this,DividerItemDecoration.VERTICAL));
hospitalAdapter = new HospitalAdapter(hospitalList);
dataBinding.recyclerViewHospital.setAdapter(hospitalAdapter);
hospitalAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent();
intent.putExtra("hospitalName",hospitalList.get(position).getName());
intent.putExtra("hospitalId",hospitalList.get(position).getId());
setResult(RESULT_OK,intent);
finish();
}
});
dataBinding.edtSearchHospital.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (s.length()>0){
viewModel.getHospitalByName(s.toString());
}else {
viewModel.getHospitalByName("");
}
}
});
}
@Override
public void initViewListener() {
super.initViewListener();
viewModel.hospitalMutableLiveData.observe(this, new Observer<List<HospitalResponse.DataBean>>() {
@Override
public void onChanged(List<HospitalResponse.DataBean> dataBeans) {
if (hospitalList!=null && hospitalList.size()>0){
hospitalList.clear();
}
hospitalList.addAll(dataBeans);
hospitalAdapter.setNewData(hospitalList);
}
});
}
@Override
protected void registerUIChangeEventObserver() {
super.registerUIChangeEventObserver();
dataBinding.ivBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
@Override
protected int initVariableId() {
return BR.ViewModel;
}
@Override
protected int setContentViewSrc(Bundle savedInstanceState) {
return R.layout.activity_hospital;
}
}
|
package com.example.spring01.controller;
import java.util.List;
import javax.inject.Inject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.example.spring01.model.dto.MemberDTO;
import com.example.spring01.service.MemberService;
@Controller
public class MemberController {
@Inject
MemberService memberService;
@RequestMapping("member/list.do")
public String list(Model model) {
List<MemberDTO> list = memberService.memberList();
model.addAttribute("items", list);
return "member/list";
}
@RequestMapping("member/write.do")
public String write() {
return "member/write";
}
@RequestMapping("member/insert.do")
public String insert(@ModelAttribute MemberDTO dto) {
memberService.insertMember(dto);
return "redirect:/member/list.do";
}
@RequestMapping("member/view.do")
public String view(@RequestParam String userid, Model model) {
model.addAttribute("dto", memberService.viewMember(userid));
return "member/view";
}
@RequestMapping("member/update.do")
public String update(@ModelAttribute MemberDTO dto, Model model) {
boolean result=memberService.checkPw(dto.getUserid(), dto.getPasswd());
if(result) {
memberService.updateMember(dto);
return "redirect:/member/list.do";
}else {
MemberDTO dto2=memberService.viewMember(dto.getUserid());
dto.setJoin_date(dto2.getJoin_date());
model.addAttribute("dto", dto);
model.addAttribute("message", "비밀번호가 일치하지 않습니다.");
return "member/view";
}
}
@RequestMapping("member/delete.do")
public String delete(@RequestParam String userid, @RequestParam String passwd, Model model) {
boolean result=memberService.checkPw(userid, passwd);
if(result) {
memberService.deleteMember(userid);
return "redirect:/member/list.do";
}else {
model.addAttribute("message", "비밀번호가 일치하지 않습니다.");
model.addAttribute("dto", memberService.viewMember(userid));
return "member/view";
}
}
}
|
package com.rockwellcollins.atc.parser.antlr.internal;
import org.eclipse.xtext.*;
import org.eclipse.xtext.parser.*;
import org.eclipse.xtext.parser.impl.*;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
import com.rockwellcollins.atc.services.LimpGrammarAccess;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
@SuppressWarnings("all")
public class InternalLimpParser extends AbstractInternalAntlrParser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_SEMANTIC_COMMENT", "RULE_STRING", "RULE_ID", "RULE_INT", "RULE_BOOLEAN", "RULE_REAL", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'import'", "'external'", "'function'", "'('", "')'", "'returns'", "'procedure'", "'equations'", "'statements'", "'type'", "'='", "'var'", "'{'", "'}'", "'enum'", "','", "'record'", "'array'", "'['", "']'", "'abstract'", "':'", "'constant'", "'global'", "';'", "'void'", "'bool'", "'int'", "'real'", "'string'", "'attributes'", "'precondition'", "'postcondition'", "'defines'", "'uses'", "'break'", "'continue'", "'return'", "'if'", "'then'", "'else'", "'while'", "'for'", "'label'", "'goto'", "'when'", "'?'", "'choice'", "'=>'", "'or'", "'and'", "'<'", "'<='", "'>'", "'>='", "'=='", "'<>'", "'+'", "'-'", "'*'", "'/'", "'not'", "'.'", "':='", "'init'", "'second_init'"
};
public static final int T__50=50;
public static final int RULE_BOOLEAN=8;
public static final int T__19=19;
public static final int T__15=15;
public static final int T__59=59;
public static final int T__16=16;
public static final int T__17=17;
public static final int T__18=18;
public static final int T__55=55;
public static final int T__56=56;
public static final int T__57=57;
public static final int T__14=14;
public static final int T__58=58;
public static final int T__51=51;
public static final int T__52=52;
public static final int T__53=53;
public static final int T__54=54;
public static final int T__60=60;
public static final int T__61=61;
public static final int RULE_ID=6;
public static final int RULE_REAL=9;
public static final int RULE_SEMANTIC_COMMENT=4;
public static final int T__26=26;
public static final int T__27=27;
public static final int T__28=28;
public static final int RULE_INT=7;
public static final int T__29=29;
public static final int T__22=22;
public static final int T__66=66;
public static final int RULE_ML_COMMENT=10;
public static final int T__23=23;
public static final int T__67=67;
public static final int T__24=24;
public static final int T__68=68;
public static final int T__25=25;
public static final int T__69=69;
public static final int T__62=62;
public static final int T__63=63;
public static final int T__20=20;
public static final int T__64=64;
public static final int T__21=21;
public static final int T__65=65;
public static final int T__70=70;
public static final int T__71=71;
public static final int T__72=72;
public static final int RULE_STRING=5;
public static final int RULE_SL_COMMENT=11;
public static final int T__37=37;
public static final int T__38=38;
public static final int T__39=39;
public static final int T__33=33;
public static final int T__77=77;
public static final int T__34=34;
public static final int T__78=78;
public static final int T__35=35;
public static final int T__79=79;
public static final int T__36=36;
public static final int T__73=73;
public static final int EOF=-1;
public static final int T__30=30;
public static final int T__74=74;
public static final int T__31=31;
public static final int T__75=75;
public static final int T__32=32;
public static final int T__76=76;
public static final int RULE_WS=12;
public static final int RULE_ANY_OTHER=13;
public static final int T__48=48;
public static final int T__49=49;
public static final int T__44=44;
public static final int T__45=45;
public static final int T__46=46;
public static final int T__47=47;
public static final int T__40=40;
public static final int T__41=41;
public static final int T__42=42;
public static final int T__43=43;
// delegates
// delegators
public InternalLimpParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public InternalLimpParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
public String[] getTokenNames() { return InternalLimpParser.tokenNames; }
public String getGrammarFileName() { return "InternalLimp.g"; }
private LimpGrammarAccess grammarAccess;
public InternalLimpParser(TokenStream input, LimpGrammarAccess grammarAccess) {
this(input);
this.grammarAccess = grammarAccess;
registerRules(grammarAccess.getGrammar());
}
@Override
protected String getFirstRuleName() {
return "Specification";
}
@Override
protected LimpGrammarAccess getGrammarAccess() {
return grammarAccess;
}
// $ANTLR start "entryRuleSpecification"
// InternalLimp.g:67:1: entryRuleSpecification returns [EObject current=null] : iv_ruleSpecification= ruleSpecification EOF ;
public final EObject entryRuleSpecification() throws RecognitionException {
EObject current = null;
EObject iv_ruleSpecification = null;
try {
// InternalLimp.g:68:2: (iv_ruleSpecification= ruleSpecification EOF )
// InternalLimp.g:69:2: iv_ruleSpecification= ruleSpecification EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getSpecificationRule());
}
pushFollow(FOLLOW_1);
iv_ruleSpecification=ruleSpecification();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleSpecification;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleSpecification"
// $ANTLR start "ruleSpecification"
// InternalLimp.g:76:1: ruleSpecification returns [EObject current=null] : ( (lv_declarations_0_0= ruleDeclaration ) )* ;
public final EObject ruleSpecification() throws RecognitionException {
EObject current = null;
EObject lv_declarations_0_0 = null;
enterRule();
try {
// InternalLimp.g:79:28: ( ( (lv_declarations_0_0= ruleDeclaration ) )* )
// InternalLimp.g:80:1: ( (lv_declarations_0_0= ruleDeclaration ) )*
{
// InternalLimp.g:80:1: ( (lv_declarations_0_0= ruleDeclaration ) )*
loop1:
do {
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0==RULE_SEMANTIC_COMMENT||(LA1_0>=14 && LA1_0<=16)||LA1_0==20||LA1_0==23||(LA1_0>=36 && LA1_0<=37)) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// InternalLimp.g:81:1: (lv_declarations_0_0= ruleDeclaration )
{
// InternalLimp.g:81:1: (lv_declarations_0_0= ruleDeclaration )
// InternalLimp.g:82:3: lv_declarations_0_0= ruleDeclaration
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getSpecificationAccess().getDeclarationsDeclarationParserRuleCall_0());
}
pushFollow(FOLLOW_3);
lv_declarations_0_0=ruleDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getSpecificationRule());
}
add(
current,
"declarations",
lv_declarations_0_0,
"com.rockwellcollins.atc.Limp.Declaration");
afterParserOrEnumRuleCall();
}
}
}
break;
default :
break loop1;
}
} while (true);
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleSpecification"
// $ANTLR start "entryRuleDeclaration"
// InternalLimp.g:106:1: entryRuleDeclaration returns [EObject current=null] : iv_ruleDeclaration= ruleDeclaration EOF ;
public final EObject entryRuleDeclaration() throws RecognitionException {
EObject current = null;
EObject iv_ruleDeclaration = null;
try {
// InternalLimp.g:107:2: (iv_ruleDeclaration= ruleDeclaration EOF )
// InternalLimp.g:108:2: iv_ruleDeclaration= ruleDeclaration EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationRule());
}
pushFollow(FOLLOW_1);
iv_ruleDeclaration=ruleDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleDeclaration;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleDeclaration"
// $ANTLR start "ruleDeclaration"
// InternalLimp.g:115:1: ruleDeclaration returns [EObject current=null] : (this_Import_0= ruleImport | this_Comment_1= ruleComment | this_ExternalFunction_2= ruleExternalFunction | this_ExternalProcedure_3= ruleExternalProcedure | this_LocalFunction_4= ruleLocalFunction | this_LocalProcedure_5= ruleLocalProcedure | this_ConstantDeclaration_6= ruleConstantDeclaration | this_GlobalDeclaration_7= ruleGlobalDeclaration | this_TypeDeclaration_8= ruleTypeDeclaration ) ;
public final EObject ruleDeclaration() throws RecognitionException {
EObject current = null;
EObject this_Import_0 = null;
EObject this_Comment_1 = null;
EObject this_ExternalFunction_2 = null;
EObject this_ExternalProcedure_3 = null;
EObject this_LocalFunction_4 = null;
EObject this_LocalProcedure_5 = null;
EObject this_ConstantDeclaration_6 = null;
EObject this_GlobalDeclaration_7 = null;
EObject this_TypeDeclaration_8 = null;
enterRule();
try {
// InternalLimp.g:118:28: ( (this_Import_0= ruleImport | this_Comment_1= ruleComment | this_ExternalFunction_2= ruleExternalFunction | this_ExternalProcedure_3= ruleExternalProcedure | this_LocalFunction_4= ruleLocalFunction | this_LocalProcedure_5= ruleLocalProcedure | this_ConstantDeclaration_6= ruleConstantDeclaration | this_GlobalDeclaration_7= ruleGlobalDeclaration | this_TypeDeclaration_8= ruleTypeDeclaration ) )
// InternalLimp.g:119:1: (this_Import_0= ruleImport | this_Comment_1= ruleComment | this_ExternalFunction_2= ruleExternalFunction | this_ExternalProcedure_3= ruleExternalProcedure | this_LocalFunction_4= ruleLocalFunction | this_LocalProcedure_5= ruleLocalProcedure | this_ConstantDeclaration_6= ruleConstantDeclaration | this_GlobalDeclaration_7= ruleGlobalDeclaration | this_TypeDeclaration_8= ruleTypeDeclaration )
{
// InternalLimp.g:119:1: (this_Import_0= ruleImport | this_Comment_1= ruleComment | this_ExternalFunction_2= ruleExternalFunction | this_ExternalProcedure_3= ruleExternalProcedure | this_LocalFunction_4= ruleLocalFunction | this_LocalProcedure_5= ruleLocalProcedure | this_ConstantDeclaration_6= ruleConstantDeclaration | this_GlobalDeclaration_7= ruleGlobalDeclaration | this_TypeDeclaration_8= ruleTypeDeclaration )
int alt2=9;
alt2 = dfa2.predict(input);
switch (alt2) {
case 1 :
// InternalLimp.g:120:5: this_Import_0= ruleImport
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getImportParserRuleCall_0());
}
pushFollow(FOLLOW_2);
this_Import_0=ruleImport();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_Import_0;
afterParserOrEnumRuleCall();
}
}
break;
case 2 :
// InternalLimp.g:130:5: this_Comment_1= ruleComment
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getCommentParserRuleCall_1());
}
pushFollow(FOLLOW_2);
this_Comment_1=ruleComment();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_Comment_1;
afterParserOrEnumRuleCall();
}
}
break;
case 3 :
// InternalLimp.g:140:5: this_ExternalFunction_2= ruleExternalFunction
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getExternalFunctionParserRuleCall_2());
}
pushFollow(FOLLOW_2);
this_ExternalFunction_2=ruleExternalFunction();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ExternalFunction_2;
afterParserOrEnumRuleCall();
}
}
break;
case 4 :
// InternalLimp.g:150:5: this_ExternalProcedure_3= ruleExternalProcedure
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getExternalProcedureParserRuleCall_3());
}
pushFollow(FOLLOW_2);
this_ExternalProcedure_3=ruleExternalProcedure();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ExternalProcedure_3;
afterParserOrEnumRuleCall();
}
}
break;
case 5 :
// InternalLimp.g:160:5: this_LocalFunction_4= ruleLocalFunction
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getLocalFunctionParserRuleCall_4());
}
pushFollow(FOLLOW_2);
this_LocalFunction_4=ruleLocalFunction();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_LocalFunction_4;
afterParserOrEnumRuleCall();
}
}
break;
case 6 :
// InternalLimp.g:170:5: this_LocalProcedure_5= ruleLocalProcedure
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getLocalProcedureParserRuleCall_5());
}
pushFollow(FOLLOW_2);
this_LocalProcedure_5=ruleLocalProcedure();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_LocalProcedure_5;
afterParserOrEnumRuleCall();
}
}
break;
case 7 :
// InternalLimp.g:180:5: this_ConstantDeclaration_6= ruleConstantDeclaration
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getConstantDeclarationParserRuleCall_6());
}
pushFollow(FOLLOW_2);
this_ConstantDeclaration_6=ruleConstantDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ConstantDeclaration_6;
afterParserOrEnumRuleCall();
}
}
break;
case 8 :
// InternalLimp.g:190:5: this_GlobalDeclaration_7= ruleGlobalDeclaration
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getGlobalDeclarationParserRuleCall_7());
}
pushFollow(FOLLOW_2);
this_GlobalDeclaration_7=ruleGlobalDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_GlobalDeclaration_7;
afterParserOrEnumRuleCall();
}
}
break;
case 9 :
// InternalLimp.g:200:5: this_TypeDeclaration_8= ruleTypeDeclaration
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDeclarationAccess().getTypeDeclarationParserRuleCall_8());
}
pushFollow(FOLLOW_2);
this_TypeDeclaration_8=ruleTypeDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_TypeDeclaration_8;
afterParserOrEnumRuleCall();
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleDeclaration"
// $ANTLR start "entryRuleComment"
// InternalLimp.g:216:1: entryRuleComment returns [EObject current=null] : iv_ruleComment= ruleComment EOF ;
public final EObject entryRuleComment() throws RecognitionException {
EObject current = null;
EObject iv_ruleComment = null;
try {
// InternalLimp.g:217:2: (iv_ruleComment= ruleComment EOF )
// InternalLimp.g:218:2: iv_ruleComment= ruleComment EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getCommentRule());
}
pushFollow(FOLLOW_1);
iv_ruleComment=ruleComment();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleComment;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleComment"
// $ANTLR start "ruleComment"
// InternalLimp.g:225:1: ruleComment returns [EObject current=null] : ( (lv_comment_0_0= RULE_SEMANTIC_COMMENT ) ) ;
public final EObject ruleComment() throws RecognitionException {
EObject current = null;
Token lv_comment_0_0=null;
enterRule();
try {
// InternalLimp.g:228:28: ( ( (lv_comment_0_0= RULE_SEMANTIC_COMMENT ) ) )
// InternalLimp.g:229:1: ( (lv_comment_0_0= RULE_SEMANTIC_COMMENT ) )
{
// InternalLimp.g:229:1: ( (lv_comment_0_0= RULE_SEMANTIC_COMMENT ) )
// InternalLimp.g:230:1: (lv_comment_0_0= RULE_SEMANTIC_COMMENT )
{
// InternalLimp.g:230:1: (lv_comment_0_0= RULE_SEMANTIC_COMMENT )
// InternalLimp.g:231:3: lv_comment_0_0= RULE_SEMANTIC_COMMENT
{
lv_comment_0_0=(Token)match(input,RULE_SEMANTIC_COMMENT,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_comment_0_0, grammarAccess.getCommentAccess().getCommentSEMANTIC_COMMENTTerminalRuleCall_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getCommentRule());
}
setWithLastConsumed(
current,
"comment",
lv_comment_0_0,
"com.rockwellcollins.atc.Limp.SEMANTIC_COMMENT");
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleComment"
// $ANTLR start "entryRuleImport"
// InternalLimp.g:255:1: entryRuleImport returns [EObject current=null] : iv_ruleImport= ruleImport EOF ;
public final EObject entryRuleImport() throws RecognitionException {
EObject current = null;
EObject iv_ruleImport = null;
try {
// InternalLimp.g:256:2: (iv_ruleImport= ruleImport EOF )
// InternalLimp.g:257:2: iv_ruleImport= ruleImport EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getImportRule());
}
pushFollow(FOLLOW_1);
iv_ruleImport=ruleImport();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleImport;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleImport"
// $ANTLR start "ruleImport"
// InternalLimp.g:264:1: ruleImport returns [EObject current=null] : (otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) ) ) ;
public final EObject ruleImport() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_importURI_1_0=null;
enterRule();
try {
// InternalLimp.g:267:28: ( (otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) ) ) )
// InternalLimp.g:268:1: (otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) ) )
{
// InternalLimp.g:268:1: (otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) ) )
// InternalLimp.g:268:3: otherlv_0= 'import' ( (lv_importURI_1_0= RULE_STRING ) )
{
otherlv_0=(Token)match(input,14,FOLLOW_4); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getImportAccess().getImportKeyword_0());
}
// InternalLimp.g:272:1: ( (lv_importURI_1_0= RULE_STRING ) )
// InternalLimp.g:273:1: (lv_importURI_1_0= RULE_STRING )
{
// InternalLimp.g:273:1: (lv_importURI_1_0= RULE_STRING )
// InternalLimp.g:274:3: lv_importURI_1_0= RULE_STRING
{
lv_importURI_1_0=(Token)match(input,RULE_STRING,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_importURI_1_0, grammarAccess.getImportAccess().getImportURISTRINGTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getImportRule());
}
setWithLastConsumed(
current,
"importURI",
lv_importURI_1_0,
"com.rockwellcollins.atc.Limp.STRING");
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleImport"
// $ANTLR start "entryRuleExternalFunction"
// InternalLimp.g:298:1: entryRuleExternalFunction returns [EObject current=null] : iv_ruleExternalFunction= ruleExternalFunction EOF ;
public final EObject entryRuleExternalFunction() throws RecognitionException {
EObject current = null;
EObject iv_ruleExternalFunction = null;
try {
// InternalLimp.g:299:2: (iv_ruleExternalFunction= ruleExternalFunction EOF )
// InternalLimp.g:300:2: iv_ruleExternalFunction= ruleExternalFunction EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExternalFunctionRule());
}
pushFollow(FOLLOW_1);
iv_ruleExternalFunction=ruleExternalFunction();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleExternalFunction;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleExternalFunction"
// $ANTLR start "ruleExternalFunction"
// InternalLimp.g:307:1: ruleExternalFunction returns [EObject current=null] : (otherlv_0= 'external' otherlv_1= 'function' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_output_8_0= ruleOutputArg ) ) otherlv_9= ')' ) ;
public final EObject ruleExternalFunction() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token lv_name_2_0=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_6=null;
Token otherlv_7=null;
Token otherlv_9=null;
EObject lv_inputs_4_0 = null;
EObject lv_output_8_0 = null;
enterRule();
try {
// InternalLimp.g:310:28: ( (otherlv_0= 'external' otherlv_1= 'function' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_output_8_0= ruleOutputArg ) ) otherlv_9= ')' ) )
// InternalLimp.g:311:1: (otherlv_0= 'external' otherlv_1= 'function' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_output_8_0= ruleOutputArg ) ) otherlv_9= ')' )
{
// InternalLimp.g:311:1: (otherlv_0= 'external' otherlv_1= 'function' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_output_8_0= ruleOutputArg ) ) otherlv_9= ')' )
// InternalLimp.g:311:3: otherlv_0= 'external' otherlv_1= 'function' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_output_8_0= ruleOutputArg ) ) otherlv_9= ')'
{
otherlv_0=(Token)match(input,15,FOLLOW_5); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getExternalFunctionAccess().getExternalKeyword_0());
}
otherlv_1=(Token)match(input,16,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getExternalFunctionAccess().getFunctionKeyword_1());
}
// InternalLimp.g:319:1: ( (lv_name_2_0= RULE_ID ) )
// InternalLimp.g:320:1: (lv_name_2_0= RULE_ID )
{
// InternalLimp.g:320:1: (lv_name_2_0= RULE_ID )
// InternalLimp.g:321:3: lv_name_2_0= RULE_ID
{
lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_2_0, grammarAccess.getExternalFunctionAccess().getNameIDTerminalRuleCall_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getExternalFunctionRule());
}
setWithLastConsumed(
current,
"name",
lv_name_2_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_3=(Token)match(input,17,FOLLOW_8); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getExternalFunctionAccess().getLeftParenthesisKeyword_3());
}
// InternalLimp.g:341:1: ( (lv_inputs_4_0= ruleInputArgList ) )
// InternalLimp.g:342:1: (lv_inputs_4_0= ruleInputArgList )
{
// InternalLimp.g:342:1: (lv_inputs_4_0= ruleInputArgList )
// InternalLimp.g:343:3: lv_inputs_4_0= ruleInputArgList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExternalFunctionAccess().getInputsInputArgListParserRuleCall_4_0());
}
pushFollow(FOLLOW_9);
lv_inputs_4_0=ruleInputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getExternalFunctionRule());
}
set(
current,
"inputs",
lv_inputs_4_0,
"com.rockwellcollins.atc.Limp.InputArgList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_5=(Token)match(input,18,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getExternalFunctionAccess().getRightParenthesisKeyword_5());
}
otherlv_6=(Token)match(input,19,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getExternalFunctionAccess().getReturnsKeyword_6());
}
otherlv_7=(Token)match(input,17,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_7, grammarAccess.getExternalFunctionAccess().getLeftParenthesisKeyword_7());
}
// InternalLimp.g:371:1: ( (lv_output_8_0= ruleOutputArg ) )
// InternalLimp.g:372:1: (lv_output_8_0= ruleOutputArg )
{
// InternalLimp.g:372:1: (lv_output_8_0= ruleOutputArg )
// InternalLimp.g:373:3: lv_output_8_0= ruleOutputArg
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExternalFunctionAccess().getOutputOutputArgParserRuleCall_8_0());
}
pushFollow(FOLLOW_9);
lv_output_8_0=ruleOutputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getExternalFunctionRule());
}
set(
current,
"output",
lv_output_8_0,
"com.rockwellcollins.atc.Limp.OutputArg");
afterParserOrEnumRuleCall();
}
}
}
otherlv_9=(Token)match(input,18,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_9, grammarAccess.getExternalFunctionAccess().getRightParenthesisKeyword_9());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleExternalFunction"
// $ANTLR start "entryRuleExternalProcedure"
// InternalLimp.g:401:1: entryRuleExternalProcedure returns [EObject current=null] : iv_ruleExternalProcedure= ruleExternalProcedure EOF ;
public final EObject entryRuleExternalProcedure() throws RecognitionException {
EObject current = null;
EObject iv_ruleExternalProcedure = null;
try {
// InternalLimp.g:402:2: (iv_ruleExternalProcedure= ruleExternalProcedure EOF )
// InternalLimp.g:403:2: iv_ruleExternalProcedure= ruleExternalProcedure EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExternalProcedureRule());
}
pushFollow(FOLLOW_1);
iv_ruleExternalProcedure=ruleExternalProcedure();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleExternalProcedure;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleExternalProcedure"
// $ANTLR start "ruleExternalProcedure"
// InternalLimp.g:410:1: ruleExternalProcedure returns [EObject current=null] : (otherlv_0= 'external' otherlv_1= 'procedure' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_outputs_8_0= ruleOutputArgList ) ) otherlv_9= ')' ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) ) ;
public final EObject ruleExternalProcedure() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token lv_name_2_0=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_6=null;
Token otherlv_7=null;
Token otherlv_9=null;
EObject lv_inputs_4_0 = null;
EObject lv_outputs_8_0 = null;
EObject lv_attributeBlock_10_0 = null;
enterRule();
try {
// InternalLimp.g:413:28: ( (otherlv_0= 'external' otherlv_1= 'procedure' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_outputs_8_0= ruleOutputArgList ) ) otherlv_9= ')' ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) ) )
// InternalLimp.g:414:1: (otherlv_0= 'external' otherlv_1= 'procedure' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_outputs_8_0= ruleOutputArgList ) ) otherlv_9= ')' ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) )
{
// InternalLimp.g:414:1: (otherlv_0= 'external' otherlv_1= 'procedure' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_outputs_8_0= ruleOutputArgList ) ) otherlv_9= ')' ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) )
// InternalLimp.g:414:3: otherlv_0= 'external' otherlv_1= 'procedure' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '(' ( (lv_inputs_4_0= ruleInputArgList ) ) otherlv_5= ')' otherlv_6= 'returns' otherlv_7= '(' ( (lv_outputs_8_0= ruleOutputArgList ) ) otherlv_9= ')' ( (lv_attributeBlock_10_0= ruleAttributeBlock ) )
{
otherlv_0=(Token)match(input,15,FOLLOW_11); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getExternalProcedureAccess().getExternalKeyword_0());
}
otherlv_1=(Token)match(input,20,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getExternalProcedureAccess().getProcedureKeyword_1());
}
// InternalLimp.g:422:1: ( (lv_name_2_0= RULE_ID ) )
// InternalLimp.g:423:1: (lv_name_2_0= RULE_ID )
{
// InternalLimp.g:423:1: (lv_name_2_0= RULE_ID )
// InternalLimp.g:424:3: lv_name_2_0= RULE_ID
{
lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_2_0, grammarAccess.getExternalProcedureAccess().getNameIDTerminalRuleCall_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getExternalProcedureRule());
}
setWithLastConsumed(
current,
"name",
lv_name_2_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_3=(Token)match(input,17,FOLLOW_8); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getExternalProcedureAccess().getLeftParenthesisKeyword_3());
}
// InternalLimp.g:444:1: ( (lv_inputs_4_0= ruleInputArgList ) )
// InternalLimp.g:445:1: (lv_inputs_4_0= ruleInputArgList )
{
// InternalLimp.g:445:1: (lv_inputs_4_0= ruleInputArgList )
// InternalLimp.g:446:3: lv_inputs_4_0= ruleInputArgList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExternalProcedureAccess().getInputsInputArgListParserRuleCall_4_0());
}
pushFollow(FOLLOW_9);
lv_inputs_4_0=ruleInputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getExternalProcedureRule());
}
set(
current,
"inputs",
lv_inputs_4_0,
"com.rockwellcollins.atc.Limp.InputArgList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_5=(Token)match(input,18,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getExternalProcedureAccess().getRightParenthesisKeyword_5());
}
otherlv_6=(Token)match(input,19,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getExternalProcedureAccess().getReturnsKeyword_6());
}
otherlv_7=(Token)match(input,17,FOLLOW_8); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_7, grammarAccess.getExternalProcedureAccess().getLeftParenthesisKeyword_7());
}
// InternalLimp.g:474:1: ( (lv_outputs_8_0= ruleOutputArgList ) )
// InternalLimp.g:475:1: (lv_outputs_8_0= ruleOutputArgList )
{
// InternalLimp.g:475:1: (lv_outputs_8_0= ruleOutputArgList )
// InternalLimp.g:476:3: lv_outputs_8_0= ruleOutputArgList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExternalProcedureAccess().getOutputsOutputArgListParserRuleCall_8_0());
}
pushFollow(FOLLOW_9);
lv_outputs_8_0=ruleOutputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getExternalProcedureRule());
}
set(
current,
"outputs",
lv_outputs_8_0,
"com.rockwellcollins.atc.Limp.OutputArgList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_9=(Token)match(input,18,FOLLOW_12); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_9, grammarAccess.getExternalProcedureAccess().getRightParenthesisKeyword_9());
}
// InternalLimp.g:496:1: ( (lv_attributeBlock_10_0= ruleAttributeBlock ) )
// InternalLimp.g:497:1: (lv_attributeBlock_10_0= ruleAttributeBlock )
{
// InternalLimp.g:497:1: (lv_attributeBlock_10_0= ruleAttributeBlock )
// InternalLimp.g:498:3: lv_attributeBlock_10_0= ruleAttributeBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExternalProcedureAccess().getAttributeBlockAttributeBlockParserRuleCall_10_0());
}
pushFollow(FOLLOW_2);
lv_attributeBlock_10_0=ruleAttributeBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getExternalProcedureRule());
}
set(
current,
"attributeBlock",
lv_attributeBlock_10_0,
"com.rockwellcollins.atc.Limp.AttributeBlock");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleExternalProcedure"
// $ANTLR start "entryRuleLocalFunction"
// InternalLimp.g:522:1: entryRuleLocalFunction returns [EObject current=null] : iv_ruleLocalFunction= ruleLocalFunction EOF ;
public final EObject entryRuleLocalFunction() throws RecognitionException {
EObject current = null;
EObject iv_ruleLocalFunction = null;
try {
// InternalLimp.g:523:2: (iv_ruleLocalFunction= ruleLocalFunction EOF )
// InternalLimp.g:524:2: iv_ruleLocalFunction= ruleLocalFunction EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalFunctionRule());
}
pushFollow(FOLLOW_1);
iv_ruleLocalFunction=ruleLocalFunction();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleLocalFunction;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleLocalFunction"
// $ANTLR start "ruleLocalFunction"
// InternalLimp.g:531:1: ruleLocalFunction returns [EObject current=null] : (otherlv_0= 'function' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_output_7_0= ruleOutputArg ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) otherlv_10= 'equations' ( (lv_equationBlock_11_0= ruleEquationBlock ) ) ) ;
public final EObject ruleLocalFunction() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
Token otherlv_5=null;
Token otherlv_6=null;
Token otherlv_8=null;
Token otherlv_10=null;
EObject lv_inputs_3_0 = null;
EObject lv_output_7_0 = null;
EObject lv_varBlock_9_0 = null;
EObject lv_equationBlock_11_0 = null;
enterRule();
try {
// InternalLimp.g:534:28: ( (otherlv_0= 'function' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_output_7_0= ruleOutputArg ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) otherlv_10= 'equations' ( (lv_equationBlock_11_0= ruleEquationBlock ) ) ) )
// InternalLimp.g:535:1: (otherlv_0= 'function' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_output_7_0= ruleOutputArg ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) otherlv_10= 'equations' ( (lv_equationBlock_11_0= ruleEquationBlock ) ) )
{
// InternalLimp.g:535:1: (otherlv_0= 'function' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_output_7_0= ruleOutputArg ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) otherlv_10= 'equations' ( (lv_equationBlock_11_0= ruleEquationBlock ) ) )
// InternalLimp.g:535:3: otherlv_0= 'function' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_output_7_0= ruleOutputArg ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) otherlv_10= 'equations' ( (lv_equationBlock_11_0= ruleEquationBlock ) )
{
otherlv_0=(Token)match(input,16,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getLocalFunctionAccess().getFunctionKeyword_0());
}
// InternalLimp.g:539:1: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:540:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:540:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:541:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getLocalFunctionAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getLocalFunctionRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_2=(Token)match(input,17,FOLLOW_8); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getLocalFunctionAccess().getLeftParenthesisKeyword_2());
}
// InternalLimp.g:561:1: ( (lv_inputs_3_0= ruleInputArgList ) )
// InternalLimp.g:562:1: (lv_inputs_3_0= ruleInputArgList )
{
// InternalLimp.g:562:1: (lv_inputs_3_0= ruleInputArgList )
// InternalLimp.g:563:3: lv_inputs_3_0= ruleInputArgList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalFunctionAccess().getInputsInputArgListParserRuleCall_3_0());
}
pushFollow(FOLLOW_9);
lv_inputs_3_0=ruleInputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalFunctionRule());
}
set(
current,
"inputs",
lv_inputs_3_0,
"com.rockwellcollins.atc.Limp.InputArgList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_4=(Token)match(input,18,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getLocalFunctionAccess().getRightParenthesisKeyword_4());
}
otherlv_5=(Token)match(input,19,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getLocalFunctionAccess().getReturnsKeyword_5());
}
otherlv_6=(Token)match(input,17,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getLocalFunctionAccess().getLeftParenthesisKeyword_6());
}
// InternalLimp.g:591:1: ( (lv_output_7_0= ruleOutputArg ) )
// InternalLimp.g:592:1: (lv_output_7_0= ruleOutputArg )
{
// InternalLimp.g:592:1: (lv_output_7_0= ruleOutputArg )
// InternalLimp.g:593:3: lv_output_7_0= ruleOutputArg
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalFunctionAccess().getOutputOutputArgParserRuleCall_7_0());
}
pushFollow(FOLLOW_9);
lv_output_7_0=ruleOutputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalFunctionRule());
}
set(
current,
"output",
lv_output_7_0,
"com.rockwellcollins.atc.Limp.OutputArg");
afterParserOrEnumRuleCall();
}
}
}
otherlv_8=(Token)match(input,18,FOLLOW_13); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_8, grammarAccess.getLocalFunctionAccess().getRightParenthesisKeyword_8());
}
// InternalLimp.g:613:1: ( (lv_varBlock_9_0= ruleVarBlock ) )
// InternalLimp.g:614:1: (lv_varBlock_9_0= ruleVarBlock )
{
// InternalLimp.g:614:1: (lv_varBlock_9_0= ruleVarBlock )
// InternalLimp.g:615:3: lv_varBlock_9_0= ruleVarBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalFunctionAccess().getVarBlockVarBlockParserRuleCall_9_0());
}
pushFollow(FOLLOW_14);
lv_varBlock_9_0=ruleVarBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalFunctionRule());
}
set(
current,
"varBlock",
lv_varBlock_9_0,
"com.rockwellcollins.atc.Limp.VarBlock");
afterParserOrEnumRuleCall();
}
}
}
otherlv_10=(Token)match(input,21,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_10, grammarAccess.getLocalFunctionAccess().getEquationsKeyword_10());
}
// InternalLimp.g:635:1: ( (lv_equationBlock_11_0= ruleEquationBlock ) )
// InternalLimp.g:636:1: (lv_equationBlock_11_0= ruleEquationBlock )
{
// InternalLimp.g:636:1: (lv_equationBlock_11_0= ruleEquationBlock )
// InternalLimp.g:637:3: lv_equationBlock_11_0= ruleEquationBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalFunctionAccess().getEquationBlockEquationBlockParserRuleCall_11_0());
}
pushFollow(FOLLOW_2);
lv_equationBlock_11_0=ruleEquationBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalFunctionRule());
}
set(
current,
"equationBlock",
lv_equationBlock_11_0,
"com.rockwellcollins.atc.Limp.EquationBlock");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleLocalFunction"
// $ANTLR start "entryRuleLocalProcedure"
// InternalLimp.g:661:1: entryRuleLocalProcedure returns [EObject current=null] : iv_ruleLocalProcedure= ruleLocalProcedure EOF ;
public final EObject entryRuleLocalProcedure() throws RecognitionException {
EObject current = null;
EObject iv_ruleLocalProcedure = null;
try {
// InternalLimp.g:662:2: (iv_ruleLocalProcedure= ruleLocalProcedure EOF )
// InternalLimp.g:663:2: iv_ruleLocalProcedure= ruleLocalProcedure EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalProcedureRule());
}
pushFollow(FOLLOW_1);
iv_ruleLocalProcedure=ruleLocalProcedure();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleLocalProcedure;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleLocalProcedure"
// $ANTLR start "ruleLocalProcedure"
// InternalLimp.g:670:1: ruleLocalProcedure returns [EObject current=null] : (otherlv_0= 'procedure' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_outputs_7_0= ruleOutputArgList ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) otherlv_11= 'statements' ( (lv_statementblock_12_0= ruleStatementBlock ) ) ) ;
public final EObject ruleLocalProcedure() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
Token otherlv_5=null;
Token otherlv_6=null;
Token otherlv_8=null;
Token otherlv_11=null;
EObject lv_inputs_3_0 = null;
EObject lv_outputs_7_0 = null;
EObject lv_varBlock_9_0 = null;
EObject lv_attributeBlock_10_0 = null;
EObject lv_statementblock_12_0 = null;
enterRule();
try {
// InternalLimp.g:673:28: ( (otherlv_0= 'procedure' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_outputs_7_0= ruleOutputArgList ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) otherlv_11= 'statements' ( (lv_statementblock_12_0= ruleStatementBlock ) ) ) )
// InternalLimp.g:674:1: (otherlv_0= 'procedure' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_outputs_7_0= ruleOutputArgList ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) otherlv_11= 'statements' ( (lv_statementblock_12_0= ruleStatementBlock ) ) )
{
// InternalLimp.g:674:1: (otherlv_0= 'procedure' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_outputs_7_0= ruleOutputArgList ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) otherlv_11= 'statements' ( (lv_statementblock_12_0= ruleStatementBlock ) ) )
// InternalLimp.g:674:3: otherlv_0= 'procedure' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '(' ( (lv_inputs_3_0= ruleInputArgList ) ) otherlv_4= ')' otherlv_5= 'returns' otherlv_6= '(' ( (lv_outputs_7_0= ruleOutputArgList ) ) otherlv_8= ')' ( (lv_varBlock_9_0= ruleVarBlock ) ) ( (lv_attributeBlock_10_0= ruleAttributeBlock ) ) otherlv_11= 'statements' ( (lv_statementblock_12_0= ruleStatementBlock ) )
{
otherlv_0=(Token)match(input,20,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getLocalProcedureAccess().getProcedureKeyword_0());
}
// InternalLimp.g:678:1: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:679:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:679:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:680:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getLocalProcedureAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getLocalProcedureRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_2=(Token)match(input,17,FOLLOW_8); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getLocalProcedureAccess().getLeftParenthesisKeyword_2());
}
// InternalLimp.g:700:1: ( (lv_inputs_3_0= ruleInputArgList ) )
// InternalLimp.g:701:1: (lv_inputs_3_0= ruleInputArgList )
{
// InternalLimp.g:701:1: (lv_inputs_3_0= ruleInputArgList )
// InternalLimp.g:702:3: lv_inputs_3_0= ruleInputArgList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalProcedureAccess().getInputsInputArgListParserRuleCall_3_0());
}
pushFollow(FOLLOW_9);
lv_inputs_3_0=ruleInputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalProcedureRule());
}
set(
current,
"inputs",
lv_inputs_3_0,
"com.rockwellcollins.atc.Limp.InputArgList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_4=(Token)match(input,18,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getLocalProcedureAccess().getRightParenthesisKeyword_4());
}
otherlv_5=(Token)match(input,19,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getLocalProcedureAccess().getReturnsKeyword_5());
}
otherlv_6=(Token)match(input,17,FOLLOW_8); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getLocalProcedureAccess().getLeftParenthesisKeyword_6());
}
// InternalLimp.g:730:1: ( (lv_outputs_7_0= ruleOutputArgList ) )
// InternalLimp.g:731:1: (lv_outputs_7_0= ruleOutputArgList )
{
// InternalLimp.g:731:1: (lv_outputs_7_0= ruleOutputArgList )
// InternalLimp.g:732:3: lv_outputs_7_0= ruleOutputArgList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalProcedureAccess().getOutputsOutputArgListParserRuleCall_7_0());
}
pushFollow(FOLLOW_9);
lv_outputs_7_0=ruleOutputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalProcedureRule());
}
set(
current,
"outputs",
lv_outputs_7_0,
"com.rockwellcollins.atc.Limp.OutputArgList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_8=(Token)match(input,18,FOLLOW_16); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_8, grammarAccess.getLocalProcedureAccess().getRightParenthesisKeyword_8());
}
// InternalLimp.g:752:1: ( (lv_varBlock_9_0= ruleVarBlock ) )
// InternalLimp.g:753:1: (lv_varBlock_9_0= ruleVarBlock )
{
// InternalLimp.g:753:1: (lv_varBlock_9_0= ruleVarBlock )
// InternalLimp.g:754:3: lv_varBlock_9_0= ruleVarBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalProcedureAccess().getVarBlockVarBlockParserRuleCall_9_0());
}
pushFollow(FOLLOW_17);
lv_varBlock_9_0=ruleVarBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalProcedureRule());
}
set(
current,
"varBlock",
lv_varBlock_9_0,
"com.rockwellcollins.atc.Limp.VarBlock");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:770:2: ( (lv_attributeBlock_10_0= ruleAttributeBlock ) )
// InternalLimp.g:771:1: (lv_attributeBlock_10_0= ruleAttributeBlock )
{
// InternalLimp.g:771:1: (lv_attributeBlock_10_0= ruleAttributeBlock )
// InternalLimp.g:772:3: lv_attributeBlock_10_0= ruleAttributeBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalProcedureAccess().getAttributeBlockAttributeBlockParserRuleCall_10_0());
}
pushFollow(FOLLOW_18);
lv_attributeBlock_10_0=ruleAttributeBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalProcedureRule());
}
set(
current,
"attributeBlock",
lv_attributeBlock_10_0,
"com.rockwellcollins.atc.Limp.AttributeBlock");
afterParserOrEnumRuleCall();
}
}
}
otherlv_11=(Token)match(input,22,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_11, grammarAccess.getLocalProcedureAccess().getStatementsKeyword_11());
}
// InternalLimp.g:792:1: ( (lv_statementblock_12_0= ruleStatementBlock ) )
// InternalLimp.g:793:1: (lv_statementblock_12_0= ruleStatementBlock )
{
// InternalLimp.g:793:1: (lv_statementblock_12_0= ruleStatementBlock )
// InternalLimp.g:794:3: lv_statementblock_12_0= ruleStatementBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalProcedureAccess().getStatementblockStatementBlockParserRuleCall_12_0());
}
pushFollow(FOLLOW_2);
lv_statementblock_12_0=ruleStatementBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalProcedureRule());
}
set(
current,
"statementblock",
lv_statementblock_12_0,
"com.rockwellcollins.atc.Limp.StatementBlock");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleLocalProcedure"
// $ANTLR start "entryRuleTypeDeclaration"
// InternalLimp.g:818:1: entryRuleTypeDeclaration returns [EObject current=null] : iv_ruleTypeDeclaration= ruleTypeDeclaration EOF ;
public final EObject entryRuleTypeDeclaration() throws RecognitionException {
EObject current = null;
EObject iv_ruleTypeDeclaration = null;
try {
// InternalLimp.g:819:2: (iv_ruleTypeDeclaration= ruleTypeDeclaration EOF )
// InternalLimp.g:820:2: iv_ruleTypeDeclaration= ruleTypeDeclaration EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTypeDeclarationRule());
}
pushFollow(FOLLOW_1);
iv_ruleTypeDeclaration=ruleTypeDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleTypeDeclaration;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleTypeDeclaration"
// $ANTLR start "ruleTypeDeclaration"
// InternalLimp.g:827:1: ruleTypeDeclaration returns [EObject current=null] : ( ( () otherlv_1= 'type' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_type_4_0= ruleType ) ) ) | this_EnumTypeDef_5= ruleEnumTypeDef | this_RecordTypeDef_6= ruleRecordTypeDef | this_ArrayTypeDef_7= ruleArrayTypeDef | this_AbstractTypeDef_8= ruleAbstractTypeDef ) ;
public final EObject ruleTypeDeclaration() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token lv_name_2_0=null;
Token otherlv_3=null;
EObject lv_type_4_0 = null;
EObject this_EnumTypeDef_5 = null;
EObject this_RecordTypeDef_6 = null;
EObject this_ArrayTypeDef_7 = null;
EObject this_AbstractTypeDef_8 = null;
enterRule();
try {
// InternalLimp.g:830:28: ( ( ( () otherlv_1= 'type' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_type_4_0= ruleType ) ) ) | this_EnumTypeDef_5= ruleEnumTypeDef | this_RecordTypeDef_6= ruleRecordTypeDef | this_ArrayTypeDef_7= ruleArrayTypeDef | this_AbstractTypeDef_8= ruleAbstractTypeDef ) )
// InternalLimp.g:831:1: ( ( () otherlv_1= 'type' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_type_4_0= ruleType ) ) ) | this_EnumTypeDef_5= ruleEnumTypeDef | this_RecordTypeDef_6= ruleRecordTypeDef | this_ArrayTypeDef_7= ruleArrayTypeDef | this_AbstractTypeDef_8= ruleAbstractTypeDef )
{
// InternalLimp.g:831:1: ( ( () otherlv_1= 'type' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_type_4_0= ruleType ) ) ) | this_EnumTypeDef_5= ruleEnumTypeDef | this_RecordTypeDef_6= ruleRecordTypeDef | this_ArrayTypeDef_7= ruleArrayTypeDef | this_AbstractTypeDef_8= ruleAbstractTypeDef )
int alt3=5;
int LA3_0 = input.LA(1);
if ( (LA3_0==23) ) {
switch ( input.LA(2) ) {
case 31:
{
alt3=4;
}
break;
case 34:
{
alt3=5;
}
break;
case RULE_ID:
{
alt3=1;
}
break;
case 30:
{
alt3=3;
}
break;
case 28:
{
alt3=2;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 3, 1, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 3, 0, input);
throw nvae;
}
switch (alt3) {
case 1 :
// InternalLimp.g:831:2: ( () otherlv_1= 'type' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_type_4_0= ruleType ) ) )
{
// InternalLimp.g:831:2: ( () otherlv_1= 'type' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_type_4_0= ruleType ) ) )
// InternalLimp.g:831:3: () otherlv_1= 'type' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_type_4_0= ruleType ) )
{
// InternalLimp.g:831:3: ()
// InternalLimp.g:832:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeDeclarationAccess().getTypeAliasAction_0_0(),
current);
}
}
otherlv_1=(Token)match(input,23,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getTypeDeclarationAccess().getTypeKeyword_0_1());
}
// InternalLimp.g:841:1: ( (lv_name_2_0= RULE_ID ) )
// InternalLimp.g:842:1: (lv_name_2_0= RULE_ID )
{
// InternalLimp.g:842:1: (lv_name_2_0= RULE_ID )
// InternalLimp.g:843:3: lv_name_2_0= RULE_ID
{
lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_19); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_2_0, grammarAccess.getTypeDeclarationAccess().getNameIDTerminalRuleCall_0_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTypeDeclarationRule());
}
setWithLastConsumed(
current,
"name",
lv_name_2_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_3=(Token)match(input,24,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getTypeDeclarationAccess().getEqualsSignKeyword_0_3());
}
// InternalLimp.g:863:1: ( (lv_type_4_0= ruleType ) )
// InternalLimp.g:864:1: (lv_type_4_0= ruleType )
{
// InternalLimp.g:864:1: (lv_type_4_0= ruleType )
// InternalLimp.g:865:3: lv_type_4_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTypeDeclarationAccess().getTypeTypeParserRuleCall_0_4_0());
}
pushFollow(FOLLOW_2);
lv_type_4_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getTypeDeclarationRule());
}
set(
current,
"type",
lv_type_4_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
}
}
break;
case 2 :
// InternalLimp.g:883:5: this_EnumTypeDef_5= ruleEnumTypeDef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTypeDeclarationAccess().getEnumTypeDefParserRuleCall_1());
}
pushFollow(FOLLOW_2);
this_EnumTypeDef_5=ruleEnumTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_EnumTypeDef_5;
afterParserOrEnumRuleCall();
}
}
break;
case 3 :
// InternalLimp.g:893:5: this_RecordTypeDef_6= ruleRecordTypeDef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTypeDeclarationAccess().getRecordTypeDefParserRuleCall_2());
}
pushFollow(FOLLOW_2);
this_RecordTypeDef_6=ruleRecordTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_RecordTypeDef_6;
afterParserOrEnumRuleCall();
}
}
break;
case 4 :
// InternalLimp.g:903:5: this_ArrayTypeDef_7= ruleArrayTypeDef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTypeDeclarationAccess().getArrayTypeDefParserRuleCall_3());
}
pushFollow(FOLLOW_2);
this_ArrayTypeDef_7=ruleArrayTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ArrayTypeDef_7;
afterParserOrEnumRuleCall();
}
}
break;
case 5 :
// InternalLimp.g:913:5: this_AbstractTypeDef_8= ruleAbstractTypeDef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTypeDeclarationAccess().getAbstractTypeDefParserRuleCall_4());
}
pushFollow(FOLLOW_2);
this_AbstractTypeDef_8=ruleAbstractTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_AbstractTypeDef_8;
afterParserOrEnumRuleCall();
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleTypeDeclaration"
// $ANTLR start "entryRuleVarBlock"
// InternalLimp.g:929:1: entryRuleVarBlock returns [EObject current=null] : iv_ruleVarBlock= ruleVarBlock EOF ;
public final EObject entryRuleVarBlock() throws RecognitionException {
EObject current = null;
EObject iv_ruleVarBlock = null;
try {
// InternalLimp.g:930:2: (iv_ruleVarBlock= ruleVarBlock EOF )
// InternalLimp.g:931:2: iv_ruleVarBlock= ruleVarBlock EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getVarBlockRule());
}
pushFollow(FOLLOW_1);
iv_ruleVarBlock=ruleVarBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleVarBlock;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleVarBlock"
// $ANTLR start "ruleVarBlock"
// InternalLimp.g:938:1: ruleVarBlock returns [EObject current=null] : ( ( () otherlv_1= 'var' otherlv_2= '{' ( (lv_locals_3_0= ruleLocalArg ) )* otherlv_4= '}' ) | () ) ;
public final EObject ruleVarBlock() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_locals_3_0 = null;
enterRule();
try {
// InternalLimp.g:941:28: ( ( ( () otherlv_1= 'var' otherlv_2= '{' ( (lv_locals_3_0= ruleLocalArg ) )* otherlv_4= '}' ) | () ) )
// InternalLimp.g:942:1: ( ( () otherlv_1= 'var' otherlv_2= '{' ( (lv_locals_3_0= ruleLocalArg ) )* otherlv_4= '}' ) | () )
{
// InternalLimp.g:942:1: ( ( () otherlv_1= 'var' otherlv_2= '{' ( (lv_locals_3_0= ruleLocalArg ) )* otherlv_4= '}' ) | () )
int alt5=2;
int LA5_0 = input.LA(1);
if ( (LA5_0==25) ) {
alt5=1;
}
else if ( (LA5_0==EOF||LA5_0==RULE_SEMANTIC_COMMENT||(LA5_0>=14 && LA5_0<=16)||(LA5_0>=20 && LA5_0<=23)||(LA5_0>=36 && LA5_0<=37)||LA5_0==44) ) {
alt5=2;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 5, 0, input);
throw nvae;
}
switch (alt5) {
case 1 :
// InternalLimp.g:942:2: ( () otherlv_1= 'var' otherlv_2= '{' ( (lv_locals_3_0= ruleLocalArg ) )* otherlv_4= '}' )
{
// InternalLimp.g:942:2: ( () otherlv_1= 'var' otherlv_2= '{' ( (lv_locals_3_0= ruleLocalArg ) )* otherlv_4= '}' )
// InternalLimp.g:942:3: () otherlv_1= 'var' otherlv_2= '{' ( (lv_locals_3_0= ruleLocalArg ) )* otherlv_4= '}'
{
// InternalLimp.g:942:3: ()
// InternalLimp.g:943:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getVarBlockAccess().getSomeVarBlockAction_0_0(),
current);
}
}
otherlv_1=(Token)match(input,25,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getVarBlockAccess().getVarKeyword_0_1());
}
otherlv_2=(Token)match(input,26,FOLLOW_21); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getVarBlockAccess().getLeftCurlyBracketKeyword_0_2());
}
// InternalLimp.g:956:1: ( (lv_locals_3_0= ruleLocalArg ) )*
loop4:
do {
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0==RULE_ID) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// InternalLimp.g:957:1: (lv_locals_3_0= ruleLocalArg )
{
// InternalLimp.g:957:1: (lv_locals_3_0= ruleLocalArg )
// InternalLimp.g:958:3: lv_locals_3_0= ruleLocalArg
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getVarBlockAccess().getLocalsLocalArgParserRuleCall_0_3_0());
}
pushFollow(FOLLOW_21);
lv_locals_3_0=ruleLocalArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getVarBlockRule());
}
add(
current,
"locals",
lv_locals_3_0,
"com.rockwellcollins.atc.Limp.LocalArg");
afterParserOrEnumRuleCall();
}
}
}
break;
default :
break loop4;
}
} while (true);
otherlv_4=(Token)match(input,27,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getVarBlockAccess().getRightCurlyBracketKeyword_0_4());
}
}
}
break;
case 2 :
// InternalLimp.g:979:6: ()
{
// InternalLimp.g:979:6: ()
// InternalLimp.g:980:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getVarBlockAccess().getNoVarBlockAction_1(),
current);
}
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleVarBlock"
// $ANTLR start "entryRuleEnumTypeDef"
// InternalLimp.g:993:1: entryRuleEnumTypeDef returns [EObject current=null] : iv_ruleEnumTypeDef= ruleEnumTypeDef EOF ;
public final EObject entryRuleEnumTypeDef() throws RecognitionException {
EObject current = null;
EObject iv_ruleEnumTypeDef = null;
try {
// InternalLimp.g:994:2: (iv_ruleEnumTypeDef= ruleEnumTypeDef EOF )
// InternalLimp.g:995:2: iv_ruleEnumTypeDef= ruleEnumTypeDef EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEnumTypeDefRule());
}
pushFollow(FOLLOW_1);
iv_ruleEnumTypeDef=ruleEnumTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleEnumTypeDef;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleEnumTypeDef"
// $ANTLR start "ruleEnumTypeDef"
// InternalLimp.g:1002:1: ruleEnumTypeDef returns [EObject current=null] : (otherlv_0= 'type' otherlv_1= 'enum' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_enumerations_5_0= ruleEnumValue ) ) (otherlv_6= ',' ( (lv_enumerations_7_0= ruleEnumValue ) ) )* otherlv_8= '}' ) ;
public final EObject ruleEnumTypeDef() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token lv_name_2_0=null;
Token otherlv_3=null;
Token otherlv_4=null;
Token otherlv_6=null;
Token otherlv_8=null;
EObject lv_enumerations_5_0 = null;
EObject lv_enumerations_7_0 = null;
enterRule();
try {
// InternalLimp.g:1005:28: ( (otherlv_0= 'type' otherlv_1= 'enum' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_enumerations_5_0= ruleEnumValue ) ) (otherlv_6= ',' ( (lv_enumerations_7_0= ruleEnumValue ) ) )* otherlv_8= '}' ) )
// InternalLimp.g:1006:1: (otherlv_0= 'type' otherlv_1= 'enum' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_enumerations_5_0= ruleEnumValue ) ) (otherlv_6= ',' ( (lv_enumerations_7_0= ruleEnumValue ) ) )* otherlv_8= '}' )
{
// InternalLimp.g:1006:1: (otherlv_0= 'type' otherlv_1= 'enum' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_enumerations_5_0= ruleEnumValue ) ) (otherlv_6= ',' ( (lv_enumerations_7_0= ruleEnumValue ) ) )* otherlv_8= '}' )
// InternalLimp.g:1006:3: otherlv_0= 'type' otherlv_1= 'enum' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_enumerations_5_0= ruleEnumValue ) ) (otherlv_6= ',' ( (lv_enumerations_7_0= ruleEnumValue ) ) )* otherlv_8= '}'
{
otherlv_0=(Token)match(input,23,FOLLOW_22); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getEnumTypeDefAccess().getTypeKeyword_0());
}
otherlv_1=(Token)match(input,28,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getEnumTypeDefAccess().getEnumKeyword_1());
}
// InternalLimp.g:1014:1: ( (lv_name_2_0= RULE_ID ) )
// InternalLimp.g:1015:1: (lv_name_2_0= RULE_ID )
{
// InternalLimp.g:1015:1: (lv_name_2_0= RULE_ID )
// InternalLimp.g:1016:3: lv_name_2_0= RULE_ID
{
lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_19); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_2_0, grammarAccess.getEnumTypeDefAccess().getNameIDTerminalRuleCall_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getEnumTypeDefRule());
}
setWithLastConsumed(
current,
"name",
lv_name_2_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_3=(Token)match(input,24,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getEnumTypeDefAccess().getEqualsSignKeyword_3());
}
otherlv_4=(Token)match(input,26,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getEnumTypeDefAccess().getLeftCurlyBracketKeyword_4());
}
// InternalLimp.g:1040:1: ( (lv_enumerations_5_0= ruleEnumValue ) )
// InternalLimp.g:1041:1: (lv_enumerations_5_0= ruleEnumValue )
{
// InternalLimp.g:1041:1: (lv_enumerations_5_0= ruleEnumValue )
// InternalLimp.g:1042:3: lv_enumerations_5_0= ruleEnumValue
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEnumTypeDefAccess().getEnumerationsEnumValueParserRuleCall_5_0());
}
pushFollow(FOLLOW_23);
lv_enumerations_5_0=ruleEnumValue();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getEnumTypeDefRule());
}
add(
current,
"enumerations",
lv_enumerations_5_0,
"com.rockwellcollins.atc.Limp.EnumValue");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:1058:2: (otherlv_6= ',' ( (lv_enumerations_7_0= ruleEnumValue ) ) )*
loop6:
do {
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==29) ) {
alt6=1;
}
switch (alt6) {
case 1 :
// InternalLimp.g:1058:4: otherlv_6= ',' ( (lv_enumerations_7_0= ruleEnumValue ) )
{
otherlv_6=(Token)match(input,29,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getEnumTypeDefAccess().getCommaKeyword_6_0());
}
// InternalLimp.g:1062:1: ( (lv_enumerations_7_0= ruleEnumValue ) )
// InternalLimp.g:1063:1: (lv_enumerations_7_0= ruleEnumValue )
{
// InternalLimp.g:1063:1: (lv_enumerations_7_0= ruleEnumValue )
// InternalLimp.g:1064:3: lv_enumerations_7_0= ruleEnumValue
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEnumTypeDefAccess().getEnumerationsEnumValueParserRuleCall_6_1_0());
}
pushFollow(FOLLOW_23);
lv_enumerations_7_0=ruleEnumValue();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getEnumTypeDefRule());
}
add(
current,
"enumerations",
lv_enumerations_7_0,
"com.rockwellcollins.atc.Limp.EnumValue");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop6;
}
} while (true);
otherlv_8=(Token)match(input,27,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_8, grammarAccess.getEnumTypeDefAccess().getRightCurlyBracketKeyword_7());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleEnumTypeDef"
// $ANTLR start "entryRuleEnumValue"
// InternalLimp.g:1092:1: entryRuleEnumValue returns [EObject current=null] : iv_ruleEnumValue= ruleEnumValue EOF ;
public final EObject entryRuleEnumValue() throws RecognitionException {
EObject current = null;
EObject iv_ruleEnumValue = null;
try {
// InternalLimp.g:1093:2: (iv_ruleEnumValue= ruleEnumValue EOF )
// InternalLimp.g:1094:2: iv_ruleEnumValue= ruleEnumValue EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEnumValueRule());
}
pushFollow(FOLLOW_1);
iv_ruleEnumValue=ruleEnumValue();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleEnumValue;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleEnumValue"
// $ANTLR start "ruleEnumValue"
// InternalLimp.g:1101:1: ruleEnumValue returns [EObject current=null] : ( () ( (lv_name_1_0= RULE_ID ) ) ) ;
public final EObject ruleEnumValue() throws RecognitionException {
EObject current = null;
Token lv_name_1_0=null;
enterRule();
try {
// InternalLimp.g:1104:28: ( ( () ( (lv_name_1_0= RULE_ID ) ) ) )
// InternalLimp.g:1105:1: ( () ( (lv_name_1_0= RULE_ID ) ) )
{
// InternalLimp.g:1105:1: ( () ( (lv_name_1_0= RULE_ID ) ) )
// InternalLimp.g:1105:2: () ( (lv_name_1_0= RULE_ID ) )
{
// InternalLimp.g:1105:2: ()
// InternalLimp.g:1106:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getEnumValueAccess().getEnumValueAction_0(),
current);
}
}
// InternalLimp.g:1111:2: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:1112:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:1112:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:1113:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getEnumValueAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getEnumValueRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleEnumValue"
// $ANTLR start "entryRuleRecordTypeDef"
// InternalLimp.g:1137:1: entryRuleRecordTypeDef returns [EObject current=null] : iv_ruleRecordTypeDef= ruleRecordTypeDef EOF ;
public final EObject entryRuleRecordTypeDef() throws RecognitionException {
EObject current = null;
EObject iv_ruleRecordTypeDef = null;
try {
// InternalLimp.g:1138:2: (iv_ruleRecordTypeDef= ruleRecordTypeDef EOF )
// InternalLimp.g:1139:2: iv_ruleRecordTypeDef= ruleRecordTypeDef EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordTypeDefRule());
}
pushFollow(FOLLOW_1);
iv_ruleRecordTypeDef=ruleRecordTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleRecordTypeDef;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRecordTypeDef"
// $ANTLR start "ruleRecordTypeDef"
// InternalLimp.g:1146:1: ruleRecordTypeDef returns [EObject current=null] : (otherlv_0= 'type' otherlv_1= 'record' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_fields_5_0= ruleRecordFieldType ) ) (otherlv_6= ',' ( (lv_fields_7_0= ruleRecordFieldType ) ) )* otherlv_8= '}' ) ;
public final EObject ruleRecordTypeDef() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token lv_name_2_0=null;
Token otherlv_3=null;
Token otherlv_4=null;
Token otherlv_6=null;
Token otherlv_8=null;
EObject lv_fields_5_0 = null;
EObject lv_fields_7_0 = null;
enterRule();
try {
// InternalLimp.g:1149:28: ( (otherlv_0= 'type' otherlv_1= 'record' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_fields_5_0= ruleRecordFieldType ) ) (otherlv_6= ',' ( (lv_fields_7_0= ruleRecordFieldType ) ) )* otherlv_8= '}' ) )
// InternalLimp.g:1150:1: (otherlv_0= 'type' otherlv_1= 'record' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_fields_5_0= ruleRecordFieldType ) ) (otherlv_6= ',' ( (lv_fields_7_0= ruleRecordFieldType ) ) )* otherlv_8= '}' )
{
// InternalLimp.g:1150:1: (otherlv_0= 'type' otherlv_1= 'record' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_fields_5_0= ruleRecordFieldType ) ) (otherlv_6= ',' ( (lv_fields_7_0= ruleRecordFieldType ) ) )* otherlv_8= '}' )
// InternalLimp.g:1150:3: otherlv_0= 'type' otherlv_1= 'record' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' otherlv_4= '{' ( (lv_fields_5_0= ruleRecordFieldType ) ) (otherlv_6= ',' ( (lv_fields_7_0= ruleRecordFieldType ) ) )* otherlv_8= '}'
{
otherlv_0=(Token)match(input,23,FOLLOW_24); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getRecordTypeDefAccess().getTypeKeyword_0());
}
otherlv_1=(Token)match(input,30,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getRecordTypeDefAccess().getRecordKeyword_1());
}
// InternalLimp.g:1158:1: ( (lv_name_2_0= RULE_ID ) )
// InternalLimp.g:1159:1: (lv_name_2_0= RULE_ID )
{
// InternalLimp.g:1159:1: (lv_name_2_0= RULE_ID )
// InternalLimp.g:1160:3: lv_name_2_0= RULE_ID
{
lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_19); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_2_0, grammarAccess.getRecordTypeDefAccess().getNameIDTerminalRuleCall_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getRecordTypeDefRule());
}
setWithLastConsumed(
current,
"name",
lv_name_2_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_3=(Token)match(input,24,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getRecordTypeDefAccess().getEqualsSignKeyword_3());
}
otherlv_4=(Token)match(input,26,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getRecordTypeDefAccess().getLeftCurlyBracketKeyword_4());
}
// InternalLimp.g:1184:1: ( (lv_fields_5_0= ruleRecordFieldType ) )
// InternalLimp.g:1185:1: (lv_fields_5_0= ruleRecordFieldType )
{
// InternalLimp.g:1185:1: (lv_fields_5_0= ruleRecordFieldType )
// InternalLimp.g:1186:3: lv_fields_5_0= ruleRecordFieldType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordTypeDefAccess().getFieldsRecordFieldTypeParserRuleCall_5_0());
}
pushFollow(FOLLOW_23);
lv_fields_5_0=ruleRecordFieldType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRecordTypeDefRule());
}
add(
current,
"fields",
lv_fields_5_0,
"com.rockwellcollins.atc.Limp.RecordFieldType");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:1202:2: (otherlv_6= ',' ( (lv_fields_7_0= ruleRecordFieldType ) ) )*
loop7:
do {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==29) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// InternalLimp.g:1202:4: otherlv_6= ',' ( (lv_fields_7_0= ruleRecordFieldType ) )
{
otherlv_6=(Token)match(input,29,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getRecordTypeDefAccess().getCommaKeyword_6_0());
}
// InternalLimp.g:1206:1: ( (lv_fields_7_0= ruleRecordFieldType ) )
// InternalLimp.g:1207:1: (lv_fields_7_0= ruleRecordFieldType )
{
// InternalLimp.g:1207:1: (lv_fields_7_0= ruleRecordFieldType )
// InternalLimp.g:1208:3: lv_fields_7_0= ruleRecordFieldType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordTypeDefAccess().getFieldsRecordFieldTypeParserRuleCall_6_1_0());
}
pushFollow(FOLLOW_23);
lv_fields_7_0=ruleRecordFieldType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRecordTypeDefRule());
}
add(
current,
"fields",
lv_fields_7_0,
"com.rockwellcollins.atc.Limp.RecordFieldType");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop7;
}
} while (true);
otherlv_8=(Token)match(input,27,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_8, grammarAccess.getRecordTypeDefAccess().getRightCurlyBracketKeyword_7());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRecordTypeDef"
// $ANTLR start "entryRuleArrayTypeDef"
// InternalLimp.g:1236:1: entryRuleArrayTypeDef returns [EObject current=null] : iv_ruleArrayTypeDef= ruleArrayTypeDef EOF ;
public final EObject entryRuleArrayTypeDef() throws RecognitionException {
EObject current = null;
EObject iv_ruleArrayTypeDef = null;
try {
// InternalLimp.g:1237:2: (iv_ruleArrayTypeDef= ruleArrayTypeDef EOF )
// InternalLimp.g:1238:2: iv_ruleArrayTypeDef= ruleArrayTypeDef EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getArrayTypeDefRule());
}
pushFollow(FOLLOW_1);
iv_ruleArrayTypeDef=ruleArrayTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleArrayTypeDef;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleArrayTypeDef"
// $ANTLR start "ruleArrayTypeDef"
// InternalLimp.g:1245:1: ruleArrayTypeDef returns [EObject current=null] : (otherlv_0= 'type' otherlv_1= 'array' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_baseType_4_0= ruleType ) ) otherlv_5= '[' ( (lv_size_6_0= RULE_INT ) ) otherlv_7= ']' ) ;
public final EObject ruleArrayTypeDef() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token lv_name_2_0=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token lv_size_6_0=null;
Token otherlv_7=null;
EObject lv_baseType_4_0 = null;
enterRule();
try {
// InternalLimp.g:1248:28: ( (otherlv_0= 'type' otherlv_1= 'array' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_baseType_4_0= ruleType ) ) otherlv_5= '[' ( (lv_size_6_0= RULE_INT ) ) otherlv_7= ']' ) )
// InternalLimp.g:1249:1: (otherlv_0= 'type' otherlv_1= 'array' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_baseType_4_0= ruleType ) ) otherlv_5= '[' ( (lv_size_6_0= RULE_INT ) ) otherlv_7= ']' )
{
// InternalLimp.g:1249:1: (otherlv_0= 'type' otherlv_1= 'array' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_baseType_4_0= ruleType ) ) otherlv_5= '[' ( (lv_size_6_0= RULE_INT ) ) otherlv_7= ']' )
// InternalLimp.g:1249:3: otherlv_0= 'type' otherlv_1= 'array' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '=' ( (lv_baseType_4_0= ruleType ) ) otherlv_5= '[' ( (lv_size_6_0= RULE_INT ) ) otherlv_7= ']'
{
otherlv_0=(Token)match(input,23,FOLLOW_25); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getArrayTypeDefAccess().getTypeKeyword_0());
}
otherlv_1=(Token)match(input,31,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getArrayTypeDefAccess().getArrayKeyword_1());
}
// InternalLimp.g:1257:1: ( (lv_name_2_0= RULE_ID ) )
// InternalLimp.g:1258:1: (lv_name_2_0= RULE_ID )
{
// InternalLimp.g:1258:1: (lv_name_2_0= RULE_ID )
// InternalLimp.g:1259:3: lv_name_2_0= RULE_ID
{
lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_19); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_2_0, grammarAccess.getArrayTypeDefAccess().getNameIDTerminalRuleCall_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getArrayTypeDefRule());
}
setWithLastConsumed(
current,
"name",
lv_name_2_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_3=(Token)match(input,24,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getArrayTypeDefAccess().getEqualsSignKeyword_3());
}
// InternalLimp.g:1279:1: ( (lv_baseType_4_0= ruleType ) )
// InternalLimp.g:1280:1: (lv_baseType_4_0= ruleType )
{
// InternalLimp.g:1280:1: (lv_baseType_4_0= ruleType )
// InternalLimp.g:1281:3: lv_baseType_4_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getArrayTypeDefAccess().getBaseTypeTypeParserRuleCall_4_0());
}
pushFollow(FOLLOW_26);
lv_baseType_4_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getArrayTypeDefRule());
}
set(
current,
"baseType",
lv_baseType_4_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
otherlv_5=(Token)match(input,32,FOLLOW_27); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getArrayTypeDefAccess().getLeftSquareBracketKeyword_5());
}
// InternalLimp.g:1301:1: ( (lv_size_6_0= RULE_INT ) )
// InternalLimp.g:1302:1: (lv_size_6_0= RULE_INT )
{
// InternalLimp.g:1302:1: (lv_size_6_0= RULE_INT )
// InternalLimp.g:1303:3: lv_size_6_0= RULE_INT
{
lv_size_6_0=(Token)match(input,RULE_INT,FOLLOW_28); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_size_6_0, grammarAccess.getArrayTypeDefAccess().getSizeINTTerminalRuleCall_6_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getArrayTypeDefRule());
}
setWithLastConsumed(
current,
"size",
lv_size_6_0,
"com.rockwellcollins.atc.Limp.INT");
}
}
}
otherlv_7=(Token)match(input,33,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_7, grammarAccess.getArrayTypeDefAccess().getRightSquareBracketKeyword_7());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleArrayTypeDef"
// $ANTLR start "entryRuleAbstractTypeDef"
// InternalLimp.g:1331:1: entryRuleAbstractTypeDef returns [EObject current=null] : iv_ruleAbstractTypeDef= ruleAbstractTypeDef EOF ;
public final EObject entryRuleAbstractTypeDef() throws RecognitionException {
EObject current = null;
EObject iv_ruleAbstractTypeDef = null;
try {
// InternalLimp.g:1332:2: (iv_ruleAbstractTypeDef= ruleAbstractTypeDef EOF )
// InternalLimp.g:1333:2: iv_ruleAbstractTypeDef= ruleAbstractTypeDef EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAbstractTypeDefRule());
}
pushFollow(FOLLOW_1);
iv_ruleAbstractTypeDef=ruleAbstractTypeDef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleAbstractTypeDef;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleAbstractTypeDef"
// $ANTLR start "ruleAbstractTypeDef"
// InternalLimp.g:1340:1: ruleAbstractTypeDef returns [EObject current=null] : (otherlv_0= 'type' otherlv_1= 'abstract' ( (lv_name_2_0= RULE_ID ) ) ) ;
public final EObject ruleAbstractTypeDef() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token lv_name_2_0=null;
enterRule();
try {
// InternalLimp.g:1343:28: ( (otherlv_0= 'type' otherlv_1= 'abstract' ( (lv_name_2_0= RULE_ID ) ) ) )
// InternalLimp.g:1344:1: (otherlv_0= 'type' otherlv_1= 'abstract' ( (lv_name_2_0= RULE_ID ) ) )
{
// InternalLimp.g:1344:1: (otherlv_0= 'type' otherlv_1= 'abstract' ( (lv_name_2_0= RULE_ID ) ) )
// InternalLimp.g:1344:3: otherlv_0= 'type' otherlv_1= 'abstract' ( (lv_name_2_0= RULE_ID ) )
{
otherlv_0=(Token)match(input,23,FOLLOW_29); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getAbstractTypeDefAccess().getTypeKeyword_0());
}
otherlv_1=(Token)match(input,34,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getAbstractTypeDefAccess().getAbstractKeyword_1());
}
// InternalLimp.g:1352:1: ( (lv_name_2_0= RULE_ID ) )
// InternalLimp.g:1353:1: (lv_name_2_0= RULE_ID )
{
// InternalLimp.g:1353:1: (lv_name_2_0= RULE_ID )
// InternalLimp.g:1354:3: lv_name_2_0= RULE_ID
{
lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_2_0, grammarAccess.getAbstractTypeDefAccess().getNameIDTerminalRuleCall_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getAbstractTypeDefRule());
}
setWithLastConsumed(
current,
"name",
lv_name_2_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleAbstractTypeDef"
// $ANTLR start "entryRuleRecordFieldType"
// InternalLimp.g:1378:1: entryRuleRecordFieldType returns [EObject current=null] : iv_ruleRecordFieldType= ruleRecordFieldType EOF ;
public final EObject entryRuleRecordFieldType() throws RecognitionException {
EObject current = null;
EObject iv_ruleRecordFieldType = null;
try {
// InternalLimp.g:1379:2: (iv_ruleRecordFieldType= ruleRecordFieldType EOF )
// InternalLimp.g:1380:2: iv_ruleRecordFieldType= ruleRecordFieldType EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordFieldTypeRule());
}
pushFollow(FOLLOW_1);
iv_ruleRecordFieldType=ruleRecordFieldType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleRecordFieldType;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRecordFieldType"
// $ANTLR start "ruleRecordFieldType"
// InternalLimp.g:1387:1: ruleRecordFieldType returns [EObject current=null] : ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_fieldType_2_0= ruleType ) ) ) ;
public final EObject ruleRecordFieldType() throws RecognitionException {
EObject current = null;
Token lv_fieldName_0_0=null;
Token otherlv_1=null;
EObject lv_fieldType_2_0 = null;
enterRule();
try {
// InternalLimp.g:1390:28: ( ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_fieldType_2_0= ruleType ) ) ) )
// InternalLimp.g:1391:1: ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_fieldType_2_0= ruleType ) ) )
{
// InternalLimp.g:1391:1: ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_fieldType_2_0= ruleType ) ) )
// InternalLimp.g:1391:2: ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_fieldType_2_0= ruleType ) )
{
// InternalLimp.g:1391:2: ( (lv_fieldName_0_0= RULE_ID ) )
// InternalLimp.g:1392:1: (lv_fieldName_0_0= RULE_ID )
{
// InternalLimp.g:1392:1: (lv_fieldName_0_0= RULE_ID )
// InternalLimp.g:1393:3: lv_fieldName_0_0= RULE_ID
{
lv_fieldName_0_0=(Token)match(input,RULE_ID,FOLLOW_30); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_fieldName_0_0, grammarAccess.getRecordFieldTypeAccess().getFieldNameIDTerminalRuleCall_0_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getRecordFieldTypeRule());
}
setWithLastConsumed(
current,
"fieldName",
lv_fieldName_0_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_1=(Token)match(input,35,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getRecordFieldTypeAccess().getColonKeyword_1());
}
// InternalLimp.g:1413:1: ( (lv_fieldType_2_0= ruleType ) )
// InternalLimp.g:1414:1: (lv_fieldType_2_0= ruleType )
{
// InternalLimp.g:1414:1: (lv_fieldType_2_0= ruleType )
// InternalLimp.g:1415:3: lv_fieldType_2_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordFieldTypeAccess().getFieldTypeTypeParserRuleCall_2_0());
}
pushFollow(FOLLOW_2);
lv_fieldType_2_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRecordFieldTypeRule());
}
set(
current,
"fieldType",
lv_fieldType_2_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRecordFieldType"
// $ANTLR start "entryRuleConstantDeclaration"
// InternalLimp.g:1439:1: entryRuleConstantDeclaration returns [EObject current=null] : iv_ruleConstantDeclaration= ruleConstantDeclaration EOF ;
public final EObject entryRuleConstantDeclaration() throws RecognitionException {
EObject current = null;
EObject iv_ruleConstantDeclaration = null;
try {
// InternalLimp.g:1440:2: (iv_ruleConstantDeclaration= ruleConstantDeclaration EOF )
// InternalLimp.g:1441:2: iv_ruleConstantDeclaration= ruleConstantDeclaration EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getConstantDeclarationRule());
}
pushFollow(FOLLOW_1);
iv_ruleConstantDeclaration=ruleConstantDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleConstantDeclaration;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleConstantDeclaration"
// $ANTLR start "ruleConstantDeclaration"
// InternalLimp.g:1448:1: ruleConstantDeclaration returns [EObject current=null] : (otherlv_0= 'constant' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) (otherlv_4= '=' ( (lv_expr_5_0= ruleExpr ) ) )? ) ;
public final EObject ruleConstantDeclaration() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_type_3_0 = null;
EObject lv_expr_5_0 = null;
enterRule();
try {
// InternalLimp.g:1451:28: ( (otherlv_0= 'constant' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) (otherlv_4= '=' ( (lv_expr_5_0= ruleExpr ) ) )? ) )
// InternalLimp.g:1452:1: (otherlv_0= 'constant' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) (otherlv_4= '=' ( (lv_expr_5_0= ruleExpr ) ) )? )
{
// InternalLimp.g:1452:1: (otherlv_0= 'constant' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) (otherlv_4= '=' ( (lv_expr_5_0= ruleExpr ) ) )? )
// InternalLimp.g:1452:3: otherlv_0= 'constant' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) (otherlv_4= '=' ( (lv_expr_5_0= ruleExpr ) ) )?
{
otherlv_0=(Token)match(input,36,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getConstantDeclarationAccess().getConstantKeyword_0());
}
// InternalLimp.g:1456:1: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:1457:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:1457:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:1458:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_30); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getConstantDeclarationAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getConstantDeclarationRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_2=(Token)match(input,35,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getConstantDeclarationAccess().getColonKeyword_2());
}
// InternalLimp.g:1478:1: ( (lv_type_3_0= ruleType ) )
// InternalLimp.g:1479:1: (lv_type_3_0= ruleType )
{
// InternalLimp.g:1479:1: (lv_type_3_0= ruleType )
// InternalLimp.g:1480:3: lv_type_3_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getConstantDeclarationAccess().getTypeTypeParserRuleCall_3_0());
}
pushFollow(FOLLOW_31);
lv_type_3_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getConstantDeclarationRule());
}
set(
current,
"type",
lv_type_3_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:1496:2: (otherlv_4= '=' ( (lv_expr_5_0= ruleExpr ) ) )?
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==24) ) {
alt8=1;
}
switch (alt8) {
case 1 :
// InternalLimp.g:1496:4: otherlv_4= '=' ( (lv_expr_5_0= ruleExpr ) )
{
otherlv_4=(Token)match(input,24,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getConstantDeclarationAccess().getEqualsSignKeyword_4_0());
}
// InternalLimp.g:1500:1: ( (lv_expr_5_0= ruleExpr ) )
// InternalLimp.g:1501:1: (lv_expr_5_0= ruleExpr )
{
// InternalLimp.g:1501:1: (lv_expr_5_0= ruleExpr )
// InternalLimp.g:1502:3: lv_expr_5_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getConstantDeclarationAccess().getExprExprParserRuleCall_4_1_0());
}
pushFollow(FOLLOW_2);
lv_expr_5_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getConstantDeclarationRule());
}
set(
current,
"expr",
lv_expr_5_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleConstantDeclaration"
// $ANTLR start "entryRuleGlobalDeclaration"
// InternalLimp.g:1526:1: entryRuleGlobalDeclaration returns [EObject current=null] : iv_ruleGlobalDeclaration= ruleGlobalDeclaration EOF ;
public final EObject entryRuleGlobalDeclaration() throws RecognitionException {
EObject current = null;
EObject iv_ruleGlobalDeclaration = null;
try {
// InternalLimp.g:1527:2: (iv_ruleGlobalDeclaration= ruleGlobalDeclaration EOF )
// InternalLimp.g:1528:2: iv_ruleGlobalDeclaration= ruleGlobalDeclaration EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getGlobalDeclarationRule());
}
pushFollow(FOLLOW_1);
iv_ruleGlobalDeclaration=ruleGlobalDeclaration();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleGlobalDeclaration;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleGlobalDeclaration"
// $ANTLR start "ruleGlobalDeclaration"
// InternalLimp.g:1535:1: ruleGlobalDeclaration returns [EObject current=null] : (otherlv_0= 'global' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) ) ;
public final EObject ruleGlobalDeclaration() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
EObject lv_type_3_0 = null;
enterRule();
try {
// InternalLimp.g:1538:28: ( (otherlv_0= 'global' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) ) )
// InternalLimp.g:1539:1: (otherlv_0= 'global' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) )
{
// InternalLimp.g:1539:1: (otherlv_0= 'global' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) ) )
// InternalLimp.g:1539:3: otherlv_0= 'global' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ':' ( (lv_type_3_0= ruleType ) )
{
otherlv_0=(Token)match(input,37,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getGlobalDeclarationAccess().getGlobalKeyword_0());
}
// InternalLimp.g:1543:1: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:1544:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:1544:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:1545:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_30); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getGlobalDeclarationAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getGlobalDeclarationRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_2=(Token)match(input,35,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getGlobalDeclarationAccess().getColonKeyword_2());
}
// InternalLimp.g:1565:1: ( (lv_type_3_0= ruleType ) )
// InternalLimp.g:1566:1: (lv_type_3_0= ruleType )
{
// InternalLimp.g:1566:1: (lv_type_3_0= ruleType )
// InternalLimp.g:1567:3: lv_type_3_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getGlobalDeclarationAccess().getTypeTypeParserRuleCall_3_0());
}
pushFollow(FOLLOW_2);
lv_type_3_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getGlobalDeclarationRule());
}
set(
current,
"type",
lv_type_3_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleGlobalDeclaration"
// $ANTLR start "entryRuleInputArgList"
// InternalLimp.g:1593:1: entryRuleInputArgList returns [EObject current=null] : iv_ruleInputArgList= ruleInputArgList EOF ;
public final EObject entryRuleInputArgList() throws RecognitionException {
EObject current = null;
EObject iv_ruleInputArgList = null;
try {
// InternalLimp.g:1594:2: (iv_ruleInputArgList= ruleInputArgList EOF )
// InternalLimp.g:1595:2: iv_ruleInputArgList= ruleInputArgList EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getInputArgListRule());
}
pushFollow(FOLLOW_1);
iv_ruleInputArgList=ruleInputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleInputArgList;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleInputArgList"
// $ANTLR start "ruleInputArgList"
// InternalLimp.g:1602:1: ruleInputArgList returns [EObject current=null] : ( () ( ( (lv_inputArgs_1_0= ruleInputArg ) ) (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )* )? ) ;
public final EObject ruleInputArgList() throws RecognitionException {
EObject current = null;
Token otherlv_2=null;
EObject lv_inputArgs_1_0 = null;
EObject lv_inputArgs_3_0 = null;
enterRule();
try {
// InternalLimp.g:1605:28: ( ( () ( ( (lv_inputArgs_1_0= ruleInputArg ) ) (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )* )? ) )
// InternalLimp.g:1606:1: ( () ( ( (lv_inputArgs_1_0= ruleInputArg ) ) (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )* )? )
{
// InternalLimp.g:1606:1: ( () ( ( (lv_inputArgs_1_0= ruleInputArg ) ) (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )* )? )
// InternalLimp.g:1606:2: () ( ( (lv_inputArgs_1_0= ruleInputArg ) ) (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )* )?
{
// InternalLimp.g:1606:2: ()
// InternalLimp.g:1607:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getInputArgListAccess().getInputArgListAction_0(),
current);
}
}
// InternalLimp.g:1612:2: ( ( (lv_inputArgs_1_0= ruleInputArg ) ) (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )* )?
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==RULE_ID) ) {
alt10=1;
}
switch (alt10) {
case 1 :
// InternalLimp.g:1612:3: ( (lv_inputArgs_1_0= ruleInputArg ) ) (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )*
{
// InternalLimp.g:1612:3: ( (lv_inputArgs_1_0= ruleInputArg ) )
// InternalLimp.g:1613:1: (lv_inputArgs_1_0= ruleInputArg )
{
// InternalLimp.g:1613:1: (lv_inputArgs_1_0= ruleInputArg )
// InternalLimp.g:1614:3: lv_inputArgs_1_0= ruleInputArg
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getInputArgListAccess().getInputArgsInputArgParserRuleCall_1_0_0());
}
pushFollow(FOLLOW_33);
lv_inputArgs_1_0=ruleInputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getInputArgListRule());
}
add(
current,
"inputArgs",
lv_inputArgs_1_0,
"com.rockwellcollins.atc.Limp.InputArg");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:1630:2: (otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) ) )*
loop9:
do {
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==29) ) {
alt9=1;
}
switch (alt9) {
case 1 :
// InternalLimp.g:1630:4: otherlv_2= ',' ( (lv_inputArgs_3_0= ruleInputArg ) )
{
otherlv_2=(Token)match(input,29,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getInputArgListAccess().getCommaKeyword_1_1_0());
}
// InternalLimp.g:1634:1: ( (lv_inputArgs_3_0= ruleInputArg ) )
// InternalLimp.g:1635:1: (lv_inputArgs_3_0= ruleInputArg )
{
// InternalLimp.g:1635:1: (lv_inputArgs_3_0= ruleInputArg )
// InternalLimp.g:1636:3: lv_inputArgs_3_0= ruleInputArg
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getInputArgListAccess().getInputArgsInputArgParserRuleCall_1_1_1_0());
}
pushFollow(FOLLOW_33);
lv_inputArgs_3_0=ruleInputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getInputArgListRule());
}
add(
current,
"inputArgs",
lv_inputArgs_3_0,
"com.rockwellcollins.atc.Limp.InputArg");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop9;
}
} while (true);
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleInputArgList"
// $ANTLR start "entryRuleInputArg"
// InternalLimp.g:1660:1: entryRuleInputArg returns [EObject current=null] : iv_ruleInputArg= ruleInputArg EOF ;
public final EObject entryRuleInputArg() throws RecognitionException {
EObject current = null;
EObject iv_ruleInputArg = null;
try {
// InternalLimp.g:1661:2: (iv_ruleInputArg= ruleInputArg EOF )
// InternalLimp.g:1662:2: iv_ruleInputArg= ruleInputArg EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getInputArgRule());
}
pushFollow(FOLLOW_1);
iv_ruleInputArg=ruleInputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleInputArg;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleInputArg"
// $ANTLR start "ruleInputArg"
// InternalLimp.g:1669:1: ruleInputArg returns [EObject current=null] : ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) ) ;
public final EObject ruleInputArg() throws RecognitionException {
EObject current = null;
Token lv_name_0_0=null;
Token otherlv_1=null;
EObject lv_type_2_0 = null;
enterRule();
try {
// InternalLimp.g:1672:28: ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) ) )
// InternalLimp.g:1673:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) )
{
// InternalLimp.g:1673:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) )
// InternalLimp.g:1673:2: ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) )
{
// InternalLimp.g:1673:2: ( (lv_name_0_0= RULE_ID ) )
// InternalLimp.g:1674:1: (lv_name_0_0= RULE_ID )
{
// InternalLimp.g:1674:1: (lv_name_0_0= RULE_ID )
// InternalLimp.g:1675:3: lv_name_0_0= RULE_ID
{
lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_30); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_0_0, grammarAccess.getInputArgAccess().getNameIDTerminalRuleCall_0_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getInputArgRule());
}
setWithLastConsumed(
current,
"name",
lv_name_0_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_1=(Token)match(input,35,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getInputArgAccess().getColonKeyword_1());
}
// InternalLimp.g:1695:1: ( (lv_type_2_0= ruleType ) )
// InternalLimp.g:1696:1: (lv_type_2_0= ruleType )
{
// InternalLimp.g:1696:1: (lv_type_2_0= ruleType )
// InternalLimp.g:1697:3: lv_type_2_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getInputArgAccess().getTypeTypeParserRuleCall_2_0());
}
pushFollow(FOLLOW_2);
lv_type_2_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getInputArgRule());
}
set(
current,
"type",
lv_type_2_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleInputArg"
// $ANTLR start "entryRuleLocalArg"
// InternalLimp.g:1721:1: entryRuleLocalArg returns [EObject current=null] : iv_ruleLocalArg= ruleLocalArg EOF ;
public final EObject entryRuleLocalArg() throws RecognitionException {
EObject current = null;
EObject iv_ruleLocalArg = null;
try {
// InternalLimp.g:1722:2: (iv_ruleLocalArg= ruleLocalArg EOF )
// InternalLimp.g:1723:2: iv_ruleLocalArg= ruleLocalArg EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalArgRule());
}
pushFollow(FOLLOW_1);
iv_ruleLocalArg=ruleLocalArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleLocalArg;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleLocalArg"
// $ANTLR start "ruleLocalArg"
// InternalLimp.g:1730:1: ruleLocalArg returns [EObject current=null] : ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) otherlv_3= ';' ) ;
public final EObject ruleLocalArg() throws RecognitionException {
EObject current = null;
Token lv_name_0_0=null;
Token otherlv_1=null;
Token otherlv_3=null;
EObject lv_type_2_0 = null;
enterRule();
try {
// InternalLimp.g:1733:28: ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) otherlv_3= ';' ) )
// InternalLimp.g:1734:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) otherlv_3= ';' )
{
// InternalLimp.g:1734:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) otherlv_3= ';' )
// InternalLimp.g:1734:2: ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) otherlv_3= ';'
{
// InternalLimp.g:1734:2: ( (lv_name_0_0= RULE_ID ) )
// InternalLimp.g:1735:1: (lv_name_0_0= RULE_ID )
{
// InternalLimp.g:1735:1: (lv_name_0_0= RULE_ID )
// InternalLimp.g:1736:3: lv_name_0_0= RULE_ID
{
lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_30); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_0_0, grammarAccess.getLocalArgAccess().getNameIDTerminalRuleCall_0_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getLocalArgRule());
}
setWithLastConsumed(
current,
"name",
lv_name_0_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_1=(Token)match(input,35,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getLocalArgAccess().getColonKeyword_1());
}
// InternalLimp.g:1756:1: ( (lv_type_2_0= ruleType ) )
// InternalLimp.g:1757:1: (lv_type_2_0= ruleType )
{
// InternalLimp.g:1757:1: (lv_type_2_0= ruleType )
// InternalLimp.g:1758:3: lv_type_2_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLocalArgAccess().getTypeTypeParserRuleCall_2_0());
}
pushFollow(FOLLOW_34);
lv_type_2_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getLocalArgRule());
}
set(
current,
"type",
lv_type_2_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
otherlv_3=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getLocalArgAccess().getSemicolonKeyword_3());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleLocalArg"
// $ANTLR start "entryRuleOutputArgList"
// InternalLimp.g:1786:1: entryRuleOutputArgList returns [EObject current=null] : iv_ruleOutputArgList= ruleOutputArgList EOF ;
public final EObject entryRuleOutputArgList() throws RecognitionException {
EObject current = null;
EObject iv_ruleOutputArgList = null;
try {
// InternalLimp.g:1787:2: (iv_ruleOutputArgList= ruleOutputArgList EOF )
// InternalLimp.g:1788:2: iv_ruleOutputArgList= ruleOutputArgList EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOutputArgListRule());
}
pushFollow(FOLLOW_1);
iv_ruleOutputArgList=ruleOutputArgList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleOutputArgList;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleOutputArgList"
// $ANTLR start "ruleOutputArgList"
// InternalLimp.g:1795:1: ruleOutputArgList returns [EObject current=null] : ( () ( ( (lv_outputArgs_1_0= ruleOutputArg ) ) (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )* )? ) ;
public final EObject ruleOutputArgList() throws RecognitionException {
EObject current = null;
Token otherlv_2=null;
EObject lv_outputArgs_1_0 = null;
EObject lv_outputArgs_3_0 = null;
enterRule();
try {
// InternalLimp.g:1798:28: ( ( () ( ( (lv_outputArgs_1_0= ruleOutputArg ) ) (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )* )? ) )
// InternalLimp.g:1799:1: ( () ( ( (lv_outputArgs_1_0= ruleOutputArg ) ) (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )* )? )
{
// InternalLimp.g:1799:1: ( () ( ( (lv_outputArgs_1_0= ruleOutputArg ) ) (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )* )? )
// InternalLimp.g:1799:2: () ( ( (lv_outputArgs_1_0= ruleOutputArg ) ) (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )* )?
{
// InternalLimp.g:1799:2: ()
// InternalLimp.g:1800:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getOutputArgListAccess().getOutputArgListAction_0(),
current);
}
}
// InternalLimp.g:1805:2: ( ( (lv_outputArgs_1_0= ruleOutputArg ) ) (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )* )?
int alt12=2;
int LA12_0 = input.LA(1);
if ( (LA12_0==RULE_ID) ) {
alt12=1;
}
switch (alt12) {
case 1 :
// InternalLimp.g:1805:3: ( (lv_outputArgs_1_0= ruleOutputArg ) ) (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )*
{
// InternalLimp.g:1805:3: ( (lv_outputArgs_1_0= ruleOutputArg ) )
// InternalLimp.g:1806:1: (lv_outputArgs_1_0= ruleOutputArg )
{
// InternalLimp.g:1806:1: (lv_outputArgs_1_0= ruleOutputArg )
// InternalLimp.g:1807:3: lv_outputArgs_1_0= ruleOutputArg
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOutputArgListAccess().getOutputArgsOutputArgParserRuleCall_1_0_0());
}
pushFollow(FOLLOW_33);
lv_outputArgs_1_0=ruleOutputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getOutputArgListRule());
}
add(
current,
"outputArgs",
lv_outputArgs_1_0,
"com.rockwellcollins.atc.Limp.OutputArg");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:1823:2: (otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) ) )*
loop11:
do {
int alt11=2;
int LA11_0 = input.LA(1);
if ( (LA11_0==29) ) {
alt11=1;
}
switch (alt11) {
case 1 :
// InternalLimp.g:1823:4: otherlv_2= ',' ( (lv_outputArgs_3_0= ruleOutputArg ) )
{
otherlv_2=(Token)match(input,29,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getOutputArgListAccess().getCommaKeyword_1_1_0());
}
// InternalLimp.g:1827:1: ( (lv_outputArgs_3_0= ruleOutputArg ) )
// InternalLimp.g:1828:1: (lv_outputArgs_3_0= ruleOutputArg )
{
// InternalLimp.g:1828:1: (lv_outputArgs_3_0= ruleOutputArg )
// InternalLimp.g:1829:3: lv_outputArgs_3_0= ruleOutputArg
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOutputArgListAccess().getOutputArgsOutputArgParserRuleCall_1_1_1_0());
}
pushFollow(FOLLOW_33);
lv_outputArgs_3_0=ruleOutputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getOutputArgListRule());
}
add(
current,
"outputArgs",
lv_outputArgs_3_0,
"com.rockwellcollins.atc.Limp.OutputArg");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop11;
}
} while (true);
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleOutputArgList"
// $ANTLR start "entryRuleOutputArg"
// InternalLimp.g:1853:1: entryRuleOutputArg returns [EObject current=null] : iv_ruleOutputArg= ruleOutputArg EOF ;
public final EObject entryRuleOutputArg() throws RecognitionException {
EObject current = null;
EObject iv_ruleOutputArg = null;
try {
// InternalLimp.g:1854:2: (iv_ruleOutputArg= ruleOutputArg EOF )
// InternalLimp.g:1855:2: iv_ruleOutputArg= ruleOutputArg EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOutputArgRule());
}
pushFollow(FOLLOW_1);
iv_ruleOutputArg=ruleOutputArg();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleOutputArg;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleOutputArg"
// $ANTLR start "ruleOutputArg"
// InternalLimp.g:1862:1: ruleOutputArg returns [EObject current=null] : ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) ) ;
public final EObject ruleOutputArg() throws RecognitionException {
EObject current = null;
Token lv_name_0_0=null;
Token otherlv_1=null;
EObject lv_type_2_0 = null;
enterRule();
try {
// InternalLimp.g:1865:28: ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) ) )
// InternalLimp.g:1866:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) )
{
// InternalLimp.g:1866:1: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) ) )
// InternalLimp.g:1866:2: ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' ( (lv_type_2_0= ruleType ) )
{
// InternalLimp.g:1866:2: ( (lv_name_0_0= RULE_ID ) )
// InternalLimp.g:1867:1: (lv_name_0_0= RULE_ID )
{
// InternalLimp.g:1867:1: (lv_name_0_0= RULE_ID )
// InternalLimp.g:1868:3: lv_name_0_0= RULE_ID
{
lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_30); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_0_0, grammarAccess.getOutputArgAccess().getNameIDTerminalRuleCall_0_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getOutputArgRule());
}
setWithLastConsumed(
current,
"name",
lv_name_0_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_1=(Token)match(input,35,FOLLOW_20); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getOutputArgAccess().getColonKeyword_1());
}
// InternalLimp.g:1888:1: ( (lv_type_2_0= ruleType ) )
// InternalLimp.g:1889:1: (lv_type_2_0= ruleType )
{
// InternalLimp.g:1889:1: (lv_type_2_0= ruleType )
// InternalLimp.g:1890:3: lv_type_2_0= ruleType
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOutputArgAccess().getTypeTypeParserRuleCall_2_0());
}
pushFollow(FOLLOW_2);
lv_type_2_0=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getOutputArgRule());
}
set(
current,
"type",
lv_type_2_0,
"com.rockwellcollins.atc.Limp.Type");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleOutputArg"
// $ANTLR start "entryRuleType"
// InternalLimp.g:1914:1: entryRuleType returns [EObject current=null] : iv_ruleType= ruleType EOF ;
public final EObject entryRuleType() throws RecognitionException {
EObject current = null;
EObject iv_ruleType = null;
try {
// InternalLimp.g:1915:2: (iv_ruleType= ruleType EOF )
// InternalLimp.g:1916:2: iv_ruleType= ruleType EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTypeRule());
}
pushFollow(FOLLOW_1);
iv_ruleType=ruleType();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleType;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleType"
// $ANTLR start "ruleType"
// InternalLimp.g:1923:1: ruleType returns [EObject current=null] : ( ( () otherlv_1= 'void' ) | ( () otherlv_3= 'bool' ) | ( () otherlv_5= 'int' ) | ( () otherlv_7= 'real' ) | ( () otherlv_9= 'string' ) | ( () otherlv_11= 'enum' ( (otherlv_12= RULE_ID ) ) ) | ( () otherlv_14= 'record' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'array' ( (otherlv_18= RULE_ID ) ) ) | ( () otherlv_20= 'abstract' ( (otherlv_21= RULE_ID ) ) ) | ( () ( (otherlv_23= RULE_ID ) ) ) ) ;
public final EObject ruleType() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_7=null;
Token otherlv_9=null;
Token otherlv_11=null;
Token otherlv_12=null;
Token otherlv_14=null;
Token otherlv_15=null;
Token otherlv_17=null;
Token otherlv_18=null;
Token otherlv_20=null;
Token otherlv_21=null;
Token otherlv_23=null;
enterRule();
try {
// InternalLimp.g:1926:28: ( ( ( () otherlv_1= 'void' ) | ( () otherlv_3= 'bool' ) | ( () otherlv_5= 'int' ) | ( () otherlv_7= 'real' ) | ( () otherlv_9= 'string' ) | ( () otherlv_11= 'enum' ( (otherlv_12= RULE_ID ) ) ) | ( () otherlv_14= 'record' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'array' ( (otherlv_18= RULE_ID ) ) ) | ( () otherlv_20= 'abstract' ( (otherlv_21= RULE_ID ) ) ) | ( () ( (otherlv_23= RULE_ID ) ) ) ) )
// InternalLimp.g:1927:1: ( ( () otherlv_1= 'void' ) | ( () otherlv_3= 'bool' ) | ( () otherlv_5= 'int' ) | ( () otherlv_7= 'real' ) | ( () otherlv_9= 'string' ) | ( () otherlv_11= 'enum' ( (otherlv_12= RULE_ID ) ) ) | ( () otherlv_14= 'record' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'array' ( (otherlv_18= RULE_ID ) ) ) | ( () otherlv_20= 'abstract' ( (otherlv_21= RULE_ID ) ) ) | ( () ( (otherlv_23= RULE_ID ) ) ) )
{
// InternalLimp.g:1927:1: ( ( () otherlv_1= 'void' ) | ( () otherlv_3= 'bool' ) | ( () otherlv_5= 'int' ) | ( () otherlv_7= 'real' ) | ( () otherlv_9= 'string' ) | ( () otherlv_11= 'enum' ( (otherlv_12= RULE_ID ) ) ) | ( () otherlv_14= 'record' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'array' ( (otherlv_18= RULE_ID ) ) ) | ( () otherlv_20= 'abstract' ( (otherlv_21= RULE_ID ) ) ) | ( () ( (otherlv_23= RULE_ID ) ) ) )
int alt13=10;
switch ( input.LA(1) ) {
case 39:
{
alt13=1;
}
break;
case 40:
{
alt13=2;
}
break;
case 41:
{
alt13=3;
}
break;
case 42:
{
alt13=4;
}
break;
case 43:
{
alt13=5;
}
break;
case 28:
{
alt13=6;
}
break;
case 30:
{
alt13=7;
}
break;
case 31:
{
alt13=8;
}
break;
case 34:
{
alt13=9;
}
break;
case RULE_ID:
{
alt13=10;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 13, 0, input);
throw nvae;
}
switch (alt13) {
case 1 :
// InternalLimp.g:1927:2: ( () otherlv_1= 'void' )
{
// InternalLimp.g:1927:2: ( () otherlv_1= 'void' )
// InternalLimp.g:1927:3: () otherlv_1= 'void'
{
// InternalLimp.g:1927:3: ()
// InternalLimp.g:1928:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getVoidTypeAction_0_0(),
current);
}
}
otherlv_1=(Token)match(input,39,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getTypeAccess().getVoidKeyword_0_1());
}
}
}
break;
case 2 :
// InternalLimp.g:1938:6: ( () otherlv_3= 'bool' )
{
// InternalLimp.g:1938:6: ( () otherlv_3= 'bool' )
// InternalLimp.g:1938:7: () otherlv_3= 'bool'
{
// InternalLimp.g:1938:7: ()
// InternalLimp.g:1939:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getBoolTypeAction_1_0(),
current);
}
}
otherlv_3=(Token)match(input,40,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getTypeAccess().getBoolKeyword_1_1());
}
}
}
break;
case 3 :
// InternalLimp.g:1949:6: ( () otherlv_5= 'int' )
{
// InternalLimp.g:1949:6: ( () otherlv_5= 'int' )
// InternalLimp.g:1949:7: () otherlv_5= 'int'
{
// InternalLimp.g:1949:7: ()
// InternalLimp.g:1950:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getIntegerTypeAction_2_0(),
current);
}
}
otherlv_5=(Token)match(input,41,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getTypeAccess().getIntKeyword_2_1());
}
}
}
break;
case 4 :
// InternalLimp.g:1960:6: ( () otherlv_7= 'real' )
{
// InternalLimp.g:1960:6: ( () otherlv_7= 'real' )
// InternalLimp.g:1960:7: () otherlv_7= 'real'
{
// InternalLimp.g:1960:7: ()
// InternalLimp.g:1961:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getRealTypeAction_3_0(),
current);
}
}
otherlv_7=(Token)match(input,42,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_7, grammarAccess.getTypeAccess().getRealKeyword_3_1());
}
}
}
break;
case 5 :
// InternalLimp.g:1971:6: ( () otherlv_9= 'string' )
{
// InternalLimp.g:1971:6: ( () otherlv_9= 'string' )
// InternalLimp.g:1971:7: () otherlv_9= 'string'
{
// InternalLimp.g:1971:7: ()
// InternalLimp.g:1972:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getStringTypeAction_4_0(),
current);
}
}
otherlv_9=(Token)match(input,43,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_9, grammarAccess.getTypeAccess().getStringKeyword_4_1());
}
}
}
break;
case 6 :
// InternalLimp.g:1982:6: ( () otherlv_11= 'enum' ( (otherlv_12= RULE_ID ) ) )
{
// InternalLimp.g:1982:6: ( () otherlv_11= 'enum' ( (otherlv_12= RULE_ID ) ) )
// InternalLimp.g:1982:7: () otherlv_11= 'enum' ( (otherlv_12= RULE_ID ) )
{
// InternalLimp.g:1982:7: ()
// InternalLimp.g:1983:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getEnumTypeAction_5_0(),
current);
}
}
otherlv_11=(Token)match(input,28,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_11, grammarAccess.getTypeAccess().getEnumKeyword_5_1());
}
// InternalLimp.g:1992:1: ( (otherlv_12= RULE_ID ) )
// InternalLimp.g:1993:1: (otherlv_12= RULE_ID )
{
// InternalLimp.g:1993:1: (otherlv_12= RULE_ID )
// InternalLimp.g:1994:3: otherlv_12= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTypeRule());
}
}
otherlv_12=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_12, grammarAccess.getTypeAccess().getEnumDefEnumTypeDefCrossReference_5_2_0());
}
}
}
}
}
break;
case 7 :
// InternalLimp.g:2006:6: ( () otherlv_14= 'record' ( (otherlv_15= RULE_ID ) ) )
{
// InternalLimp.g:2006:6: ( () otherlv_14= 'record' ( (otherlv_15= RULE_ID ) ) )
// InternalLimp.g:2006:7: () otherlv_14= 'record' ( (otherlv_15= RULE_ID ) )
{
// InternalLimp.g:2006:7: ()
// InternalLimp.g:2007:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getRecordTypeAction_6_0(),
current);
}
}
otherlv_14=(Token)match(input,30,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_14, grammarAccess.getTypeAccess().getRecordKeyword_6_1());
}
// InternalLimp.g:2016:1: ( (otherlv_15= RULE_ID ) )
// InternalLimp.g:2017:1: (otherlv_15= RULE_ID )
{
// InternalLimp.g:2017:1: (otherlv_15= RULE_ID )
// InternalLimp.g:2018:3: otherlv_15= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTypeRule());
}
}
otherlv_15=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_15, grammarAccess.getTypeAccess().getRecordDefRecordTypeDefCrossReference_6_2_0());
}
}
}
}
}
break;
case 8 :
// InternalLimp.g:2030:6: ( () otherlv_17= 'array' ( (otherlv_18= RULE_ID ) ) )
{
// InternalLimp.g:2030:6: ( () otherlv_17= 'array' ( (otherlv_18= RULE_ID ) ) )
// InternalLimp.g:2030:7: () otherlv_17= 'array' ( (otherlv_18= RULE_ID ) )
{
// InternalLimp.g:2030:7: ()
// InternalLimp.g:2031:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getArrayTypeAction_7_0(),
current);
}
}
otherlv_17=(Token)match(input,31,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_17, grammarAccess.getTypeAccess().getArrayKeyword_7_1());
}
// InternalLimp.g:2040:1: ( (otherlv_18= RULE_ID ) )
// InternalLimp.g:2041:1: (otherlv_18= RULE_ID )
{
// InternalLimp.g:2041:1: (otherlv_18= RULE_ID )
// InternalLimp.g:2042:3: otherlv_18= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTypeRule());
}
}
otherlv_18=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_18, grammarAccess.getTypeAccess().getArrayDefArrayTypeDefCrossReference_7_2_0());
}
}
}
}
}
break;
case 9 :
// InternalLimp.g:2054:6: ( () otherlv_20= 'abstract' ( (otherlv_21= RULE_ID ) ) )
{
// InternalLimp.g:2054:6: ( () otherlv_20= 'abstract' ( (otherlv_21= RULE_ID ) ) )
// InternalLimp.g:2054:7: () otherlv_20= 'abstract' ( (otherlv_21= RULE_ID ) )
{
// InternalLimp.g:2054:7: ()
// InternalLimp.g:2055:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getAbstractTypeAction_8_0(),
current);
}
}
otherlv_20=(Token)match(input,34,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_20, grammarAccess.getTypeAccess().getAbstractKeyword_8_1());
}
// InternalLimp.g:2064:1: ( (otherlv_21= RULE_ID ) )
// InternalLimp.g:2065:1: (otherlv_21= RULE_ID )
{
// InternalLimp.g:2065:1: (otherlv_21= RULE_ID )
// InternalLimp.g:2066:3: otherlv_21= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTypeRule());
}
}
otherlv_21=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_21, grammarAccess.getTypeAccess().getAbstractDefAbstractTypeDefCrossReference_8_2_0());
}
}
}
}
}
break;
case 10 :
// InternalLimp.g:2078:6: ( () ( (otherlv_23= RULE_ID ) ) )
{
// InternalLimp.g:2078:6: ( () ( (otherlv_23= RULE_ID ) ) )
// InternalLimp.g:2078:7: () ( (otherlv_23= RULE_ID ) )
{
// InternalLimp.g:2078:7: ()
// InternalLimp.g:2079:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTypeAccess().getNamedTypeAction_9_0(),
current);
}
}
// InternalLimp.g:2084:2: ( (otherlv_23= RULE_ID ) )
// InternalLimp.g:2085:1: (otherlv_23= RULE_ID )
{
// InternalLimp.g:2085:1: (otherlv_23= RULE_ID )
// InternalLimp.g:2086:3: otherlv_23= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTypeRule());
}
}
otherlv_23=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_23, grammarAccess.getTypeAccess().getAliasTypeAliasCrossReference_9_1_0());
}
}
}
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleType"
// $ANTLR start "entryRuleAttributeBlock"
// InternalLimp.g:2105:1: entryRuleAttributeBlock returns [EObject current=null] : iv_ruleAttributeBlock= ruleAttributeBlock EOF ;
public final EObject entryRuleAttributeBlock() throws RecognitionException {
EObject current = null;
EObject iv_ruleAttributeBlock = null;
try {
// InternalLimp.g:2106:2: (iv_ruleAttributeBlock= ruleAttributeBlock EOF )
// InternalLimp.g:2107:2: iv_ruleAttributeBlock= ruleAttributeBlock EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAttributeBlockRule());
}
pushFollow(FOLLOW_1);
iv_ruleAttributeBlock=ruleAttributeBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleAttributeBlock;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleAttributeBlock"
// $ANTLR start "ruleAttributeBlock"
// InternalLimp.g:2114:1: ruleAttributeBlock returns [EObject current=null] : ( ( () otherlv_1= 'attributes' otherlv_2= '{' ( (lv_attributeList_3_0= ruleAttribute ) )* otherlv_4= '}' ) | () ) ;
public final EObject ruleAttributeBlock() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_attributeList_3_0 = null;
enterRule();
try {
// InternalLimp.g:2117:28: ( ( ( () otherlv_1= 'attributes' otherlv_2= '{' ( (lv_attributeList_3_0= ruleAttribute ) )* otherlv_4= '}' ) | () ) )
// InternalLimp.g:2118:1: ( ( () otherlv_1= 'attributes' otherlv_2= '{' ( (lv_attributeList_3_0= ruleAttribute ) )* otherlv_4= '}' ) | () )
{
// InternalLimp.g:2118:1: ( ( () otherlv_1= 'attributes' otherlv_2= '{' ( (lv_attributeList_3_0= ruleAttribute ) )* otherlv_4= '}' ) | () )
int alt15=2;
int LA15_0 = input.LA(1);
if ( (LA15_0==44) ) {
alt15=1;
}
else if ( (LA15_0==EOF||LA15_0==RULE_SEMANTIC_COMMENT||(LA15_0>=14 && LA15_0<=16)||LA15_0==20||(LA15_0>=22 && LA15_0<=23)||(LA15_0>=36 && LA15_0<=37)) ) {
alt15=2;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 15, 0, input);
throw nvae;
}
switch (alt15) {
case 1 :
// InternalLimp.g:2118:2: ( () otherlv_1= 'attributes' otherlv_2= '{' ( (lv_attributeList_3_0= ruleAttribute ) )* otherlv_4= '}' )
{
// InternalLimp.g:2118:2: ( () otherlv_1= 'attributes' otherlv_2= '{' ( (lv_attributeList_3_0= ruleAttribute ) )* otherlv_4= '}' )
// InternalLimp.g:2118:3: () otherlv_1= 'attributes' otherlv_2= '{' ( (lv_attributeList_3_0= ruleAttribute ) )* otherlv_4= '}'
{
// InternalLimp.g:2118:3: ()
// InternalLimp.g:2119:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getAttributeBlockAccess().getSomeAttributeBlockAction_0_0(),
current);
}
}
otherlv_1=(Token)match(input,44,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getAttributeBlockAccess().getAttributesKeyword_0_1());
}
otherlv_2=(Token)match(input,26,FOLLOW_35); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getAttributeBlockAccess().getLeftCurlyBracketKeyword_0_2());
}
// InternalLimp.g:2132:1: ( (lv_attributeList_3_0= ruleAttribute ) )*
loop14:
do {
int alt14=2;
int LA14_0 = input.LA(1);
if ( ((LA14_0>=45 && LA14_0<=48)) ) {
alt14=1;
}
switch (alt14) {
case 1 :
// InternalLimp.g:2133:1: (lv_attributeList_3_0= ruleAttribute )
{
// InternalLimp.g:2133:1: (lv_attributeList_3_0= ruleAttribute )
// InternalLimp.g:2134:3: lv_attributeList_3_0= ruleAttribute
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAttributeBlockAccess().getAttributeListAttributeParserRuleCall_0_3_0());
}
pushFollow(FOLLOW_35);
lv_attributeList_3_0=ruleAttribute();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getAttributeBlockRule());
}
add(
current,
"attributeList",
lv_attributeList_3_0,
"com.rockwellcollins.atc.Limp.Attribute");
afterParserOrEnumRuleCall();
}
}
}
break;
default :
break loop14;
}
} while (true);
otherlv_4=(Token)match(input,27,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getAttributeBlockAccess().getRightCurlyBracketKeyword_0_4());
}
}
}
break;
case 2 :
// InternalLimp.g:2155:6: ()
{
// InternalLimp.g:2155:6: ()
// InternalLimp.g:2156:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getAttributeBlockAccess().getNoAttributeBlockAction_1(),
current);
}
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleAttributeBlock"
// $ANTLR start "entryRuleAttribute"
// InternalLimp.g:2169:1: entryRuleAttribute returns [EObject current=null] : iv_ruleAttribute= ruleAttribute EOF ;
public final EObject entryRuleAttribute() throws RecognitionException {
EObject current = null;
EObject iv_ruleAttribute = null;
try {
// InternalLimp.g:2170:2: (iv_ruleAttribute= ruleAttribute EOF )
// InternalLimp.g:2171:2: iv_ruleAttribute= ruleAttribute EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAttributeRule());
}
pushFollow(FOLLOW_1);
iv_ruleAttribute=ruleAttribute();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleAttribute;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleAttribute"
// $ANTLR start "ruleAttribute"
// InternalLimp.g:2178:1: ruleAttribute returns [EObject current=null] : (this_Precondition_0= rulePrecondition | this_Postcondition_1= rulePostcondition | this_Define_2= ruleDefine | this_Uses_3= ruleUses ) ;
public final EObject ruleAttribute() throws RecognitionException {
EObject current = null;
EObject this_Precondition_0 = null;
EObject this_Postcondition_1 = null;
EObject this_Define_2 = null;
EObject this_Uses_3 = null;
enterRule();
try {
// InternalLimp.g:2181:28: ( (this_Precondition_0= rulePrecondition | this_Postcondition_1= rulePostcondition | this_Define_2= ruleDefine | this_Uses_3= ruleUses ) )
// InternalLimp.g:2182:1: (this_Precondition_0= rulePrecondition | this_Postcondition_1= rulePostcondition | this_Define_2= ruleDefine | this_Uses_3= ruleUses )
{
// InternalLimp.g:2182:1: (this_Precondition_0= rulePrecondition | this_Postcondition_1= rulePostcondition | this_Define_2= ruleDefine | this_Uses_3= ruleUses )
int alt16=4;
switch ( input.LA(1) ) {
case 45:
{
alt16=1;
}
break;
case 46:
{
alt16=2;
}
break;
case 47:
{
alt16=3;
}
break;
case 48:
{
alt16=4;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 16, 0, input);
throw nvae;
}
switch (alt16) {
case 1 :
// InternalLimp.g:2183:5: this_Precondition_0= rulePrecondition
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAttributeAccess().getPreconditionParserRuleCall_0());
}
pushFollow(FOLLOW_2);
this_Precondition_0=rulePrecondition();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_Precondition_0;
afterParserOrEnumRuleCall();
}
}
break;
case 2 :
// InternalLimp.g:2193:5: this_Postcondition_1= rulePostcondition
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAttributeAccess().getPostconditionParserRuleCall_1());
}
pushFollow(FOLLOW_2);
this_Postcondition_1=rulePostcondition();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_Postcondition_1;
afterParserOrEnumRuleCall();
}
}
break;
case 3 :
// InternalLimp.g:2203:5: this_Define_2= ruleDefine
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAttributeAccess().getDefineParserRuleCall_2());
}
pushFollow(FOLLOW_2);
this_Define_2=ruleDefine();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_Define_2;
afterParserOrEnumRuleCall();
}
}
break;
case 4 :
// InternalLimp.g:2213:5: this_Uses_3= ruleUses
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAttributeAccess().getUsesParserRuleCall_3());
}
pushFollow(FOLLOW_2);
this_Uses_3=ruleUses();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_Uses_3;
afterParserOrEnumRuleCall();
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleAttribute"
// $ANTLR start "entryRulePrecondition"
// InternalLimp.g:2229:1: entryRulePrecondition returns [EObject current=null] : iv_rulePrecondition= rulePrecondition EOF ;
public final EObject entryRulePrecondition() throws RecognitionException {
EObject current = null;
EObject iv_rulePrecondition = null;
try {
// InternalLimp.g:2230:2: (iv_rulePrecondition= rulePrecondition EOF )
// InternalLimp.g:2231:2: iv_rulePrecondition= rulePrecondition EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getPreconditionRule());
}
pushFollow(FOLLOW_1);
iv_rulePrecondition=rulePrecondition();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_rulePrecondition;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRulePrecondition"
// $ANTLR start "rulePrecondition"
// InternalLimp.g:2238:1: rulePrecondition returns [EObject current=null] : (otherlv_0= 'precondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' ) ;
public final EObject rulePrecondition() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_expr_3_0 = null;
enterRule();
try {
// InternalLimp.g:2241:28: ( (otherlv_0= 'precondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' ) )
// InternalLimp.g:2242:1: (otherlv_0= 'precondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' )
{
// InternalLimp.g:2242:1: (otherlv_0= 'precondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' )
// InternalLimp.g:2242:3: otherlv_0= 'precondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';'
{
otherlv_0=(Token)match(input,45,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getPreconditionAccess().getPreconditionKeyword_0());
}
// InternalLimp.g:2246:1: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:2247:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:2247:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:2248:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_19); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getPreconditionAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getPreconditionRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_2=(Token)match(input,24,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getPreconditionAccess().getEqualsSignKeyword_2());
}
// InternalLimp.g:2268:1: ( (lv_expr_3_0= ruleExpr ) )
// InternalLimp.g:2269:1: (lv_expr_3_0= ruleExpr )
{
// InternalLimp.g:2269:1: (lv_expr_3_0= ruleExpr )
// InternalLimp.g:2270:3: lv_expr_3_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getPreconditionAccess().getExprExprParserRuleCall_3_0());
}
pushFollow(FOLLOW_34);
lv_expr_3_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getPreconditionRule());
}
set(
current,
"expr",
lv_expr_3_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_4=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getPreconditionAccess().getSemicolonKeyword_4());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "rulePrecondition"
// $ANTLR start "entryRulePostcondition"
// InternalLimp.g:2298:1: entryRulePostcondition returns [EObject current=null] : iv_rulePostcondition= rulePostcondition EOF ;
public final EObject entryRulePostcondition() throws RecognitionException {
EObject current = null;
EObject iv_rulePostcondition = null;
try {
// InternalLimp.g:2299:2: (iv_rulePostcondition= rulePostcondition EOF )
// InternalLimp.g:2300:2: iv_rulePostcondition= rulePostcondition EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getPostconditionRule());
}
pushFollow(FOLLOW_1);
iv_rulePostcondition=rulePostcondition();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_rulePostcondition;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRulePostcondition"
// $ANTLR start "rulePostcondition"
// InternalLimp.g:2307:1: rulePostcondition returns [EObject current=null] : (otherlv_0= 'postcondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' ) ;
public final EObject rulePostcondition() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_expr_3_0 = null;
enterRule();
try {
// InternalLimp.g:2310:28: ( (otherlv_0= 'postcondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' ) )
// InternalLimp.g:2311:1: (otherlv_0= 'postcondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' )
{
// InternalLimp.g:2311:1: (otherlv_0= 'postcondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';' )
// InternalLimp.g:2311:3: otherlv_0= 'postcondition' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_expr_3_0= ruleExpr ) ) otherlv_4= ';'
{
otherlv_0=(Token)match(input,46,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getPostconditionAccess().getPostconditionKeyword_0());
}
// InternalLimp.g:2315:1: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:2316:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:2316:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:2317:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_19); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getPostconditionAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getPostconditionRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_2=(Token)match(input,24,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getPostconditionAccess().getEqualsSignKeyword_2());
}
// InternalLimp.g:2337:1: ( (lv_expr_3_0= ruleExpr ) )
// InternalLimp.g:2338:1: (lv_expr_3_0= ruleExpr )
{
// InternalLimp.g:2338:1: (lv_expr_3_0= ruleExpr )
// InternalLimp.g:2339:3: lv_expr_3_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getPostconditionAccess().getExprExprParserRuleCall_3_0());
}
pushFollow(FOLLOW_34);
lv_expr_3_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getPostconditionRule());
}
set(
current,
"expr",
lv_expr_3_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_4=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getPostconditionAccess().getSemicolonKeyword_4());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "rulePostcondition"
// $ANTLR start "entryRuleDefineUseRef"
// InternalLimp.g:2367:1: entryRuleDefineUseRef returns [EObject current=null] : iv_ruleDefineUseRef= ruleDefineUseRef EOF ;
public final EObject entryRuleDefineUseRef() throws RecognitionException {
EObject current = null;
EObject iv_ruleDefineUseRef = null;
try {
// InternalLimp.g:2368:2: (iv_ruleDefineUseRef= ruleDefineUseRef EOF )
// InternalLimp.g:2369:2: iv_ruleDefineUseRef= ruleDefineUseRef EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDefineUseRefRule());
}
pushFollow(FOLLOW_1);
iv_ruleDefineUseRef=ruleDefineUseRef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleDefineUseRef;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleDefineUseRef"
// $ANTLR start "ruleDefineUseRef"
// InternalLimp.g:2376:1: ruleDefineUseRef returns [EObject current=null] : ( (lv_referenceExpr_0_0= ruleExpr ) ) ;
public final EObject ruleDefineUseRef() throws RecognitionException {
EObject current = null;
EObject lv_referenceExpr_0_0 = null;
enterRule();
try {
// InternalLimp.g:2379:28: ( ( (lv_referenceExpr_0_0= ruleExpr ) ) )
// InternalLimp.g:2380:1: ( (lv_referenceExpr_0_0= ruleExpr ) )
{
// InternalLimp.g:2380:1: ( (lv_referenceExpr_0_0= ruleExpr ) )
// InternalLimp.g:2381:1: (lv_referenceExpr_0_0= ruleExpr )
{
// InternalLimp.g:2381:1: (lv_referenceExpr_0_0= ruleExpr )
// InternalLimp.g:2382:3: lv_referenceExpr_0_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDefineUseRefAccess().getReferenceExprExprParserRuleCall_0());
}
pushFollow(FOLLOW_2);
lv_referenceExpr_0_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getDefineUseRefRule());
}
set(
current,
"referenceExpr",
lv_referenceExpr_0_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleDefineUseRef"
// $ANTLR start "entryRuleDefine"
// InternalLimp.g:2406:1: entryRuleDefine returns [EObject current=null] : iv_ruleDefine= ruleDefine EOF ;
public final EObject entryRuleDefine() throws RecognitionException {
EObject current = null;
EObject iv_ruleDefine = null;
try {
// InternalLimp.g:2407:2: (iv_ruleDefine= ruleDefine EOF )
// InternalLimp.g:2408:2: iv_ruleDefine= ruleDefine EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDefineRule());
}
pushFollow(FOLLOW_1);
iv_ruleDefine=ruleDefine();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleDefine;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleDefine"
// $ANTLR start "ruleDefine"
// InternalLimp.g:2415:1: ruleDefine returns [EObject current=null] : (otherlv_0= 'defines' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' ) ;
public final EObject ruleDefine() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_elements_1_0 = null;
EObject lv_elements_3_0 = null;
enterRule();
try {
// InternalLimp.g:2418:28: ( (otherlv_0= 'defines' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' ) )
// InternalLimp.g:2419:1: (otherlv_0= 'defines' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' )
{
// InternalLimp.g:2419:1: (otherlv_0= 'defines' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' )
// InternalLimp.g:2419:3: otherlv_0= 'defines' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';'
{
otherlv_0=(Token)match(input,47,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getDefineAccess().getDefinesKeyword_0());
}
// InternalLimp.g:2423:1: ( (lv_elements_1_0= ruleDefineUseRef ) )
// InternalLimp.g:2424:1: (lv_elements_1_0= ruleDefineUseRef )
{
// InternalLimp.g:2424:1: (lv_elements_1_0= ruleDefineUseRef )
// InternalLimp.g:2425:3: lv_elements_1_0= ruleDefineUseRef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDefineAccess().getElementsDefineUseRefParserRuleCall_1_0());
}
pushFollow(FOLLOW_36);
lv_elements_1_0=ruleDefineUseRef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getDefineRule());
}
add(
current,
"elements",
lv_elements_1_0,
"com.rockwellcollins.atc.Limp.DefineUseRef");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:2441:2: (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )*
loop17:
do {
int alt17=2;
int LA17_0 = input.LA(1);
if ( (LA17_0==29) ) {
alt17=1;
}
switch (alt17) {
case 1 :
// InternalLimp.g:2441:4: otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) )
{
otherlv_2=(Token)match(input,29,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getDefineAccess().getCommaKeyword_2_0());
}
// InternalLimp.g:2445:1: ( (lv_elements_3_0= ruleDefineUseRef ) )
// InternalLimp.g:2446:1: (lv_elements_3_0= ruleDefineUseRef )
{
// InternalLimp.g:2446:1: (lv_elements_3_0= ruleDefineUseRef )
// InternalLimp.g:2447:3: lv_elements_3_0= ruleDefineUseRef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getDefineAccess().getElementsDefineUseRefParserRuleCall_2_1_0());
}
pushFollow(FOLLOW_36);
lv_elements_3_0=ruleDefineUseRef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getDefineRule());
}
add(
current,
"elements",
lv_elements_3_0,
"com.rockwellcollins.atc.Limp.DefineUseRef");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop17;
}
} while (true);
otherlv_4=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getDefineAccess().getSemicolonKeyword_3());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleDefine"
// $ANTLR start "entryRuleUses"
// InternalLimp.g:2475:1: entryRuleUses returns [EObject current=null] : iv_ruleUses= ruleUses EOF ;
public final EObject entryRuleUses() throws RecognitionException {
EObject current = null;
EObject iv_ruleUses = null;
try {
// InternalLimp.g:2476:2: (iv_ruleUses= ruleUses EOF )
// InternalLimp.g:2477:2: iv_ruleUses= ruleUses EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getUsesRule());
}
pushFollow(FOLLOW_1);
iv_ruleUses=ruleUses();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleUses;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleUses"
// $ANTLR start "ruleUses"
// InternalLimp.g:2484:1: ruleUses returns [EObject current=null] : (otherlv_0= 'uses' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' ) ;
public final EObject ruleUses() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject lv_elements_1_0 = null;
EObject lv_elements_3_0 = null;
enterRule();
try {
// InternalLimp.g:2487:28: ( (otherlv_0= 'uses' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' ) )
// InternalLimp.g:2488:1: (otherlv_0= 'uses' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' )
{
// InternalLimp.g:2488:1: (otherlv_0= 'uses' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';' )
// InternalLimp.g:2488:3: otherlv_0= 'uses' ( (lv_elements_1_0= ruleDefineUseRef ) ) (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )* otherlv_4= ';'
{
otherlv_0=(Token)match(input,48,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getUsesAccess().getUsesKeyword_0());
}
// InternalLimp.g:2492:1: ( (lv_elements_1_0= ruleDefineUseRef ) )
// InternalLimp.g:2493:1: (lv_elements_1_0= ruleDefineUseRef )
{
// InternalLimp.g:2493:1: (lv_elements_1_0= ruleDefineUseRef )
// InternalLimp.g:2494:3: lv_elements_1_0= ruleDefineUseRef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getUsesAccess().getElementsDefineUseRefParserRuleCall_1_0());
}
pushFollow(FOLLOW_36);
lv_elements_1_0=ruleDefineUseRef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getUsesRule());
}
add(
current,
"elements",
lv_elements_1_0,
"com.rockwellcollins.atc.Limp.DefineUseRef");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:2510:2: (otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) ) )*
loop18:
do {
int alt18=2;
int LA18_0 = input.LA(1);
if ( (LA18_0==29) ) {
alt18=1;
}
switch (alt18) {
case 1 :
// InternalLimp.g:2510:4: otherlv_2= ',' ( (lv_elements_3_0= ruleDefineUseRef ) )
{
otherlv_2=(Token)match(input,29,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getUsesAccess().getCommaKeyword_2_0());
}
// InternalLimp.g:2514:1: ( (lv_elements_3_0= ruleDefineUseRef ) )
// InternalLimp.g:2515:1: (lv_elements_3_0= ruleDefineUseRef )
{
// InternalLimp.g:2515:1: (lv_elements_3_0= ruleDefineUseRef )
// InternalLimp.g:2516:3: lv_elements_3_0= ruleDefineUseRef
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getUsesAccess().getElementsDefineUseRefParserRuleCall_2_1_0());
}
pushFollow(FOLLOW_36);
lv_elements_3_0=ruleDefineUseRef();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getUsesRule());
}
add(
current,
"elements",
lv_elements_3_0,
"com.rockwellcollins.atc.Limp.DefineUseRef");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop18;
}
} while (true);
otherlv_4=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getUsesAccess().getSemicolonKeyword_3());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleUses"
// $ANTLR start "entryRuleStatementBlock"
// InternalLimp.g:2544:1: entryRuleStatementBlock returns [EObject current=null] : iv_ruleStatementBlock= ruleStatementBlock EOF ;
public final EObject entryRuleStatementBlock() throws RecognitionException {
EObject current = null;
EObject iv_ruleStatementBlock = null;
try {
// InternalLimp.g:2545:2: (iv_ruleStatementBlock= ruleStatementBlock EOF )
// InternalLimp.g:2546:2: iv_ruleStatementBlock= ruleStatementBlock EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementBlockRule());
}
pushFollow(FOLLOW_1);
iv_ruleStatementBlock=ruleStatementBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleStatementBlock;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleStatementBlock"
// $ANTLR start "ruleStatementBlock"
// InternalLimp.g:2553:1: ruleStatementBlock returns [EObject current=null] : ( () otherlv_1= '{' ( (lv_statements_2_0= ruleStatement ) )* otherlv_3= '}' ) ;
public final EObject ruleStatementBlock() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
EObject lv_statements_2_0 = null;
enterRule();
try {
// InternalLimp.g:2556:28: ( ( () otherlv_1= '{' ( (lv_statements_2_0= ruleStatement ) )* otherlv_3= '}' ) )
// InternalLimp.g:2557:1: ( () otherlv_1= '{' ( (lv_statements_2_0= ruleStatement ) )* otherlv_3= '}' )
{
// InternalLimp.g:2557:1: ( () otherlv_1= '{' ( (lv_statements_2_0= ruleStatement ) )* otherlv_3= '}' )
// InternalLimp.g:2557:2: () otherlv_1= '{' ( (lv_statements_2_0= ruleStatement ) )* otherlv_3= '}'
{
// InternalLimp.g:2557:2: ()
// InternalLimp.g:2558:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getStatementBlockAccess().getStatementBlockAction_0(),
current);
}
}
otherlv_1=(Token)match(input,26,FOLLOW_37); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getStatementBlockAccess().getLeftCurlyBracketKeyword_1());
}
// InternalLimp.g:2567:1: ( (lv_statements_2_0= ruleStatement ) )*
loop19:
do {
int alt19=2;
int LA19_0 = input.LA(1);
if ( ((LA19_0>=RULE_STRING && LA19_0<=RULE_REAL)||LA19_0==17||(LA19_0>=30 && LA19_0<=31)||(LA19_0>=49 && LA19_0<=52)||(LA19_0>=55 && LA19_0<=58)||LA19_0==61||(LA19_0>=72 && LA19_0<=73)||LA19_0==75||(LA19_0>=78 && LA19_0<=79)) ) {
alt19=1;
}
switch (alt19) {
case 1 :
// InternalLimp.g:2568:1: (lv_statements_2_0= ruleStatement )
{
// InternalLimp.g:2568:1: (lv_statements_2_0= ruleStatement )
// InternalLimp.g:2569:3: lv_statements_2_0= ruleStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementBlockAccess().getStatementsStatementParserRuleCall_2_0());
}
pushFollow(FOLLOW_37);
lv_statements_2_0=ruleStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getStatementBlockRule());
}
add(
current,
"statements",
lv_statements_2_0,
"com.rockwellcollins.atc.Limp.Statement");
afterParserOrEnumRuleCall();
}
}
}
break;
default :
break loop19;
}
} while (true);
otherlv_3=(Token)match(input,27,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getStatementBlockAccess().getRightCurlyBracketKeyword_3());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleStatementBlock"
// $ANTLR start "entryRuleStatement"
// InternalLimp.g:2597:1: entryRuleStatement returns [EObject current=null] : iv_ruleStatement= ruleStatement EOF ;
public final EObject entryRuleStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleStatement = null;
try {
// InternalLimp.g:2598:2: (iv_ruleStatement= ruleStatement EOF )
// InternalLimp.g:2599:2: iv_ruleStatement= ruleStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleStatement=ruleStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleStatement"
// $ANTLR start "ruleStatement"
// InternalLimp.g:2606:1: ruleStatement returns [EObject current=null] : (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement | this_IfThenElseStatement_2= ruleIfThenElseStatement | this_WhileStatement_3= ruleWhileStatement | this_ForStatement_4= ruleForStatement | this_GotoStatement_5= ruleGotoStatement | this_LabelStatement_6= ruleLabelStatement | ( () otherlv_8= 'break' otherlv_9= ';' ) | ( () otherlv_11= 'continue' otherlv_12= ';' ) | ( () otherlv_14= 'return' otherlv_15= ';' ) ) ;
public final EObject ruleStatement() throws RecognitionException {
EObject current = null;
Token otherlv_8=null;
Token otherlv_9=null;
Token otherlv_11=null;
Token otherlv_12=null;
Token otherlv_14=null;
Token otherlv_15=null;
EObject this_VoidStatement_0 = null;
EObject this_AssignmentStatement_1 = null;
EObject this_IfThenElseStatement_2 = null;
EObject this_WhileStatement_3 = null;
EObject this_ForStatement_4 = null;
EObject this_GotoStatement_5 = null;
EObject this_LabelStatement_6 = null;
enterRule();
try {
// InternalLimp.g:2609:28: ( (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement | this_IfThenElseStatement_2= ruleIfThenElseStatement | this_WhileStatement_3= ruleWhileStatement | this_ForStatement_4= ruleForStatement | this_GotoStatement_5= ruleGotoStatement | this_LabelStatement_6= ruleLabelStatement | ( () otherlv_8= 'break' otherlv_9= ';' ) | ( () otherlv_11= 'continue' otherlv_12= ';' ) | ( () otherlv_14= 'return' otherlv_15= ';' ) ) )
// InternalLimp.g:2610:1: (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement | this_IfThenElseStatement_2= ruleIfThenElseStatement | this_WhileStatement_3= ruleWhileStatement | this_ForStatement_4= ruleForStatement | this_GotoStatement_5= ruleGotoStatement | this_LabelStatement_6= ruleLabelStatement | ( () otherlv_8= 'break' otherlv_9= ';' ) | ( () otherlv_11= 'continue' otherlv_12= ';' ) | ( () otherlv_14= 'return' otherlv_15= ';' ) )
{
// InternalLimp.g:2610:1: (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement | this_IfThenElseStatement_2= ruleIfThenElseStatement | this_WhileStatement_3= ruleWhileStatement | this_ForStatement_4= ruleForStatement | this_GotoStatement_5= ruleGotoStatement | this_LabelStatement_6= ruleLabelStatement | ( () otherlv_8= 'break' otherlv_9= ';' ) | ( () otherlv_11= 'continue' otherlv_12= ';' ) | ( () otherlv_14= 'return' otherlv_15= ';' ) )
int alt20=10;
alt20 = dfa20.predict(input);
switch (alt20) {
case 1 :
// InternalLimp.g:2611:5: this_VoidStatement_0= ruleVoidStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementAccess().getVoidStatementParserRuleCall_0());
}
pushFollow(FOLLOW_2);
this_VoidStatement_0=ruleVoidStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_VoidStatement_0;
afterParserOrEnumRuleCall();
}
}
break;
case 2 :
// InternalLimp.g:2621:5: this_AssignmentStatement_1= ruleAssignmentStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementAccess().getAssignmentStatementParserRuleCall_1());
}
pushFollow(FOLLOW_2);
this_AssignmentStatement_1=ruleAssignmentStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_AssignmentStatement_1;
afterParserOrEnumRuleCall();
}
}
break;
case 3 :
// InternalLimp.g:2631:5: this_IfThenElseStatement_2= ruleIfThenElseStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementAccess().getIfThenElseStatementParserRuleCall_2());
}
pushFollow(FOLLOW_2);
this_IfThenElseStatement_2=ruleIfThenElseStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_IfThenElseStatement_2;
afterParserOrEnumRuleCall();
}
}
break;
case 4 :
// InternalLimp.g:2641:5: this_WhileStatement_3= ruleWhileStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementAccess().getWhileStatementParserRuleCall_3());
}
pushFollow(FOLLOW_2);
this_WhileStatement_3=ruleWhileStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_WhileStatement_3;
afterParserOrEnumRuleCall();
}
}
break;
case 5 :
// InternalLimp.g:2651:5: this_ForStatement_4= ruleForStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementAccess().getForStatementParserRuleCall_4());
}
pushFollow(FOLLOW_2);
this_ForStatement_4=ruleForStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ForStatement_4;
afterParserOrEnumRuleCall();
}
}
break;
case 6 :
// InternalLimp.g:2661:5: this_GotoStatement_5= ruleGotoStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementAccess().getGotoStatementParserRuleCall_5());
}
pushFollow(FOLLOW_2);
this_GotoStatement_5=ruleGotoStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_GotoStatement_5;
afterParserOrEnumRuleCall();
}
}
break;
case 7 :
// InternalLimp.g:2671:5: this_LabelStatement_6= ruleLabelStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getStatementAccess().getLabelStatementParserRuleCall_6());
}
pushFollow(FOLLOW_2);
this_LabelStatement_6=ruleLabelStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_LabelStatement_6;
afterParserOrEnumRuleCall();
}
}
break;
case 8 :
// InternalLimp.g:2680:6: ( () otherlv_8= 'break' otherlv_9= ';' )
{
// InternalLimp.g:2680:6: ( () otherlv_8= 'break' otherlv_9= ';' )
// InternalLimp.g:2680:7: () otherlv_8= 'break' otherlv_9= ';'
{
// InternalLimp.g:2680:7: ()
// InternalLimp.g:2681:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getStatementAccess().getBreakStatementAction_7_0(),
current);
}
}
otherlv_8=(Token)match(input,49,FOLLOW_34); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_8, grammarAccess.getStatementAccess().getBreakKeyword_7_1());
}
otherlv_9=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_9, grammarAccess.getStatementAccess().getSemicolonKeyword_7_2());
}
}
}
break;
case 9 :
// InternalLimp.g:2695:6: ( () otherlv_11= 'continue' otherlv_12= ';' )
{
// InternalLimp.g:2695:6: ( () otherlv_11= 'continue' otherlv_12= ';' )
// InternalLimp.g:2695:7: () otherlv_11= 'continue' otherlv_12= ';'
{
// InternalLimp.g:2695:7: ()
// InternalLimp.g:2696:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getStatementAccess().getContinueStatementAction_8_0(),
current);
}
}
otherlv_11=(Token)match(input,50,FOLLOW_34); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_11, grammarAccess.getStatementAccess().getContinueKeyword_8_1());
}
otherlv_12=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_12, grammarAccess.getStatementAccess().getSemicolonKeyword_8_2());
}
}
}
break;
case 10 :
// InternalLimp.g:2710:6: ( () otherlv_14= 'return' otherlv_15= ';' )
{
// InternalLimp.g:2710:6: ( () otherlv_14= 'return' otherlv_15= ';' )
// InternalLimp.g:2710:7: () otherlv_14= 'return' otherlv_15= ';'
{
// InternalLimp.g:2710:7: ()
// InternalLimp.g:2711:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getStatementAccess().getReturnStatementAction_9_0(),
current);
}
}
otherlv_14=(Token)match(input,51,FOLLOW_34); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_14, grammarAccess.getStatementAccess().getReturnKeyword_9_1());
}
otherlv_15=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_15, grammarAccess.getStatementAccess().getSemicolonKeyword_9_2());
}
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleStatement"
// $ANTLR start "entryRuleVoidStatement"
// InternalLimp.g:2732:1: entryRuleVoidStatement returns [EObject current=null] : iv_ruleVoidStatement= ruleVoidStatement EOF ;
public final EObject entryRuleVoidStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleVoidStatement = null;
try {
// InternalLimp.g:2733:2: (iv_ruleVoidStatement= ruleVoidStatement EOF )
// InternalLimp.g:2734:2: iv_ruleVoidStatement= ruleVoidStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getVoidStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleVoidStatement=ruleVoidStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleVoidStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleVoidStatement"
// $ANTLR start "ruleVoidStatement"
// InternalLimp.g:2741:1: ruleVoidStatement returns [EObject current=null] : ( ( (lv_expr_0_0= ruleExpr ) ) otherlv_1= ';' ) ;
public final EObject ruleVoidStatement() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
EObject lv_expr_0_0 = null;
enterRule();
try {
// InternalLimp.g:2744:28: ( ( ( (lv_expr_0_0= ruleExpr ) ) otherlv_1= ';' ) )
// InternalLimp.g:2745:1: ( ( (lv_expr_0_0= ruleExpr ) ) otherlv_1= ';' )
{
// InternalLimp.g:2745:1: ( ( (lv_expr_0_0= ruleExpr ) ) otherlv_1= ';' )
// InternalLimp.g:2745:2: ( (lv_expr_0_0= ruleExpr ) ) otherlv_1= ';'
{
// InternalLimp.g:2745:2: ( (lv_expr_0_0= ruleExpr ) )
// InternalLimp.g:2746:1: (lv_expr_0_0= ruleExpr )
{
// InternalLimp.g:2746:1: (lv_expr_0_0= ruleExpr )
// InternalLimp.g:2747:3: lv_expr_0_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getVoidStatementAccess().getExprExprParserRuleCall_0_0());
}
pushFollow(FOLLOW_34);
lv_expr_0_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getVoidStatementRule());
}
set(
current,
"expr",
lv_expr_0_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_1=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getVoidStatementAccess().getSemicolonKeyword_1());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleVoidStatement"
// $ANTLR start "entryRuleAssignmentStatement"
// InternalLimp.g:2775:1: entryRuleAssignmentStatement returns [EObject current=null] : iv_ruleAssignmentStatement= ruleAssignmentStatement EOF ;
public final EObject entryRuleAssignmentStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleAssignmentStatement = null;
try {
// InternalLimp.g:2776:2: (iv_ruleAssignmentStatement= ruleAssignmentStatement EOF )
// InternalLimp.g:2777:2: iv_ruleAssignmentStatement= ruleAssignmentStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAssignmentStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleAssignmentStatement=ruleAssignmentStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleAssignmentStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleAssignmentStatement"
// $ANTLR start "ruleAssignmentStatement"
// InternalLimp.g:2784:1: ruleAssignmentStatement returns [EObject current=null] : ( ( (lv_ids_0_0= ruleIdList ) ) otherlv_1= '=' ( (lv_rhs_2_0= ruleExpr ) ) otherlv_3= ';' ) ;
public final EObject ruleAssignmentStatement() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
EObject lv_ids_0_0 = null;
EObject lv_rhs_2_0 = null;
enterRule();
try {
// InternalLimp.g:2787:28: ( ( ( (lv_ids_0_0= ruleIdList ) ) otherlv_1= '=' ( (lv_rhs_2_0= ruleExpr ) ) otherlv_3= ';' ) )
// InternalLimp.g:2788:1: ( ( (lv_ids_0_0= ruleIdList ) ) otherlv_1= '=' ( (lv_rhs_2_0= ruleExpr ) ) otherlv_3= ';' )
{
// InternalLimp.g:2788:1: ( ( (lv_ids_0_0= ruleIdList ) ) otherlv_1= '=' ( (lv_rhs_2_0= ruleExpr ) ) otherlv_3= ';' )
// InternalLimp.g:2788:2: ( (lv_ids_0_0= ruleIdList ) ) otherlv_1= '=' ( (lv_rhs_2_0= ruleExpr ) ) otherlv_3= ';'
{
// InternalLimp.g:2788:2: ( (lv_ids_0_0= ruleIdList ) )
// InternalLimp.g:2789:1: (lv_ids_0_0= ruleIdList )
{
// InternalLimp.g:2789:1: (lv_ids_0_0= ruleIdList )
// InternalLimp.g:2790:3: lv_ids_0_0= ruleIdList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAssignmentStatementAccess().getIdsIdListParserRuleCall_0_0());
}
pushFollow(FOLLOW_19);
lv_ids_0_0=ruleIdList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getAssignmentStatementRule());
}
set(
current,
"ids",
lv_ids_0_0,
"com.rockwellcollins.atc.Limp.IdList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_1=(Token)match(input,24,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getAssignmentStatementAccess().getEqualsSignKeyword_1());
}
// InternalLimp.g:2810:1: ( (lv_rhs_2_0= ruleExpr ) )
// InternalLimp.g:2811:1: (lv_rhs_2_0= ruleExpr )
{
// InternalLimp.g:2811:1: (lv_rhs_2_0= ruleExpr )
// InternalLimp.g:2812:3: lv_rhs_2_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAssignmentStatementAccess().getRhsExprParserRuleCall_2_0());
}
pushFollow(FOLLOW_34);
lv_rhs_2_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getAssignmentStatementRule());
}
set(
current,
"rhs",
lv_rhs_2_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_3=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getAssignmentStatementAccess().getSemicolonKeyword_3());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleAssignmentStatement"
// $ANTLR start "entryRuleIfThenElseStatement"
// InternalLimp.g:2840:1: entryRuleIfThenElseStatement returns [EObject current=null] : iv_ruleIfThenElseStatement= ruleIfThenElseStatement EOF ;
public final EObject entryRuleIfThenElseStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleIfThenElseStatement = null;
try {
// InternalLimp.g:2841:2: (iv_ruleIfThenElseStatement= ruleIfThenElseStatement EOF )
// InternalLimp.g:2842:2: iv_ruleIfThenElseStatement= ruleIfThenElseStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleIfThenElseStatement=ruleIfThenElseStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleIfThenElseStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleIfThenElseStatement"
// $ANTLR start "ruleIfThenElseStatement"
// InternalLimp.g:2849:1: ruleIfThenElseStatement returns [EObject current=null] : (otherlv_0= 'if' ( (lv_cond_1_0= ruleExpr ) ) otherlv_2= 'then' ( (lv_thenBlock_3_0= ruleStatementBlock ) ) ( (lv_else_4_0= ruleElse ) ) ) ;
public final EObject ruleIfThenElseStatement() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_2=null;
EObject lv_cond_1_0 = null;
EObject lv_thenBlock_3_0 = null;
EObject lv_else_4_0 = null;
enterRule();
try {
// InternalLimp.g:2852:28: ( (otherlv_0= 'if' ( (lv_cond_1_0= ruleExpr ) ) otherlv_2= 'then' ( (lv_thenBlock_3_0= ruleStatementBlock ) ) ( (lv_else_4_0= ruleElse ) ) ) )
// InternalLimp.g:2853:1: (otherlv_0= 'if' ( (lv_cond_1_0= ruleExpr ) ) otherlv_2= 'then' ( (lv_thenBlock_3_0= ruleStatementBlock ) ) ( (lv_else_4_0= ruleElse ) ) )
{
// InternalLimp.g:2853:1: (otherlv_0= 'if' ( (lv_cond_1_0= ruleExpr ) ) otherlv_2= 'then' ( (lv_thenBlock_3_0= ruleStatementBlock ) ) ( (lv_else_4_0= ruleElse ) ) )
// InternalLimp.g:2853:3: otherlv_0= 'if' ( (lv_cond_1_0= ruleExpr ) ) otherlv_2= 'then' ( (lv_thenBlock_3_0= ruleStatementBlock ) ) ( (lv_else_4_0= ruleElse ) )
{
otherlv_0=(Token)match(input,52,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getIfThenElseStatementAccess().getIfKeyword_0());
}
// InternalLimp.g:2857:1: ( (lv_cond_1_0= ruleExpr ) )
// InternalLimp.g:2858:1: (lv_cond_1_0= ruleExpr )
{
// InternalLimp.g:2858:1: (lv_cond_1_0= ruleExpr )
// InternalLimp.g:2859:3: lv_cond_1_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseStatementAccess().getCondExprParserRuleCall_1_0());
}
pushFollow(FOLLOW_38);
lv_cond_1_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getIfThenElseStatementRule());
}
set(
current,
"cond",
lv_cond_1_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_2=(Token)match(input,53,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getIfThenElseStatementAccess().getThenKeyword_2());
}
// InternalLimp.g:2879:1: ( (lv_thenBlock_3_0= ruleStatementBlock ) )
// InternalLimp.g:2880:1: (lv_thenBlock_3_0= ruleStatementBlock )
{
// InternalLimp.g:2880:1: (lv_thenBlock_3_0= ruleStatementBlock )
// InternalLimp.g:2881:3: lv_thenBlock_3_0= ruleStatementBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseStatementAccess().getThenBlockStatementBlockParserRuleCall_3_0());
}
pushFollow(FOLLOW_39);
lv_thenBlock_3_0=ruleStatementBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getIfThenElseStatementRule());
}
set(
current,
"thenBlock",
lv_thenBlock_3_0,
"com.rockwellcollins.atc.Limp.StatementBlock");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:2897:2: ( (lv_else_4_0= ruleElse ) )
// InternalLimp.g:2898:1: (lv_else_4_0= ruleElse )
{
// InternalLimp.g:2898:1: (lv_else_4_0= ruleElse )
// InternalLimp.g:2899:3: lv_else_4_0= ruleElse
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseStatementAccess().getElseElseParserRuleCall_4_0());
}
pushFollow(FOLLOW_2);
lv_else_4_0=ruleElse();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getIfThenElseStatementRule());
}
set(
current,
"else",
lv_else_4_0,
"com.rockwellcollins.atc.Limp.Else");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleIfThenElseStatement"
// $ANTLR start "entryRuleElse"
// InternalLimp.g:2923:1: entryRuleElse returns [EObject current=null] : iv_ruleElse= ruleElse EOF ;
public final EObject entryRuleElse() throws RecognitionException {
EObject current = null;
EObject iv_ruleElse = null;
try {
// InternalLimp.g:2924:2: (iv_ruleElse= ruleElse EOF )
// InternalLimp.g:2925:2: iv_ruleElse= ruleElse EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getElseRule());
}
pushFollow(FOLLOW_1);
iv_ruleElse=ruleElse();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleElse;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleElse"
// $ANTLR start "ruleElse"
// InternalLimp.g:2932:1: ruleElse returns [EObject current=null] : ( ( () otherlv_1= 'else' ( (lv_block_2_0= ruleStatementBlock ) ) ) | ( () otherlv_4= 'else' ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) ) ) | () ) ;
public final EObject ruleElse() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_4=null;
EObject lv_block_2_0 = null;
EObject lv_ifThenElse_5_0 = null;
enterRule();
try {
// InternalLimp.g:2935:28: ( ( ( () otherlv_1= 'else' ( (lv_block_2_0= ruleStatementBlock ) ) ) | ( () otherlv_4= 'else' ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) ) ) | () ) )
// InternalLimp.g:2936:1: ( ( () otherlv_1= 'else' ( (lv_block_2_0= ruleStatementBlock ) ) ) | ( () otherlv_4= 'else' ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) ) ) | () )
{
// InternalLimp.g:2936:1: ( ( () otherlv_1= 'else' ( (lv_block_2_0= ruleStatementBlock ) ) ) | ( () otherlv_4= 'else' ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) ) ) | () )
int alt21=3;
int LA21_0 = input.LA(1);
if ( (LA21_0==54) ) {
int LA21_1 = input.LA(2);
if ( (LA21_1==26) ) {
alt21=1;
}
else if ( (LA21_1==52) ) {
alt21=2;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 21, 1, input);
throw nvae;
}
}
else if ( (LA21_0==EOF||(LA21_0>=RULE_STRING && LA21_0<=RULE_REAL)||LA21_0==17||LA21_0==27||(LA21_0>=30 && LA21_0<=31)||(LA21_0>=49 && LA21_0<=52)||(LA21_0>=55 && LA21_0<=58)||LA21_0==61||(LA21_0>=72 && LA21_0<=73)||LA21_0==75||(LA21_0>=78 && LA21_0<=79)) ) {
alt21=3;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 21, 0, input);
throw nvae;
}
switch (alt21) {
case 1 :
// InternalLimp.g:2936:2: ( () otherlv_1= 'else' ( (lv_block_2_0= ruleStatementBlock ) ) )
{
// InternalLimp.g:2936:2: ( () otherlv_1= 'else' ( (lv_block_2_0= ruleStatementBlock ) ) )
// InternalLimp.g:2936:3: () otherlv_1= 'else' ( (lv_block_2_0= ruleStatementBlock ) )
{
// InternalLimp.g:2936:3: ()
// InternalLimp.g:2937:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getElseAccess().getElseBlockAction_0_0(),
current);
}
}
otherlv_1=(Token)match(input,54,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getElseAccess().getElseKeyword_0_1());
}
// InternalLimp.g:2946:1: ( (lv_block_2_0= ruleStatementBlock ) )
// InternalLimp.g:2947:1: (lv_block_2_0= ruleStatementBlock )
{
// InternalLimp.g:2947:1: (lv_block_2_0= ruleStatementBlock )
// InternalLimp.g:2948:3: lv_block_2_0= ruleStatementBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getElseAccess().getBlockStatementBlockParserRuleCall_0_2_0());
}
pushFollow(FOLLOW_2);
lv_block_2_0=ruleStatementBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getElseRule());
}
set(
current,
"block",
lv_block_2_0,
"com.rockwellcollins.atc.Limp.StatementBlock");
afterParserOrEnumRuleCall();
}
}
}
}
}
break;
case 2 :
// InternalLimp.g:2965:6: ( () otherlv_4= 'else' ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) ) )
{
// InternalLimp.g:2965:6: ( () otherlv_4= 'else' ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) ) )
// InternalLimp.g:2965:7: () otherlv_4= 'else' ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) )
{
// InternalLimp.g:2965:7: ()
// InternalLimp.g:2966:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getElseAccess().getElseIfAction_1_0(),
current);
}
}
otherlv_4=(Token)match(input,54,FOLLOW_40); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getElseAccess().getElseKeyword_1_1());
}
// InternalLimp.g:2975:1: ( (lv_ifThenElse_5_0= ruleIfThenElseStatement ) )
// InternalLimp.g:2976:1: (lv_ifThenElse_5_0= ruleIfThenElseStatement )
{
// InternalLimp.g:2976:1: (lv_ifThenElse_5_0= ruleIfThenElseStatement )
// InternalLimp.g:2977:3: lv_ifThenElse_5_0= ruleIfThenElseStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getElseAccess().getIfThenElseIfThenElseStatementParserRuleCall_1_2_0());
}
pushFollow(FOLLOW_2);
lv_ifThenElse_5_0=ruleIfThenElseStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getElseRule());
}
set(
current,
"ifThenElse",
lv_ifThenElse_5_0,
"com.rockwellcollins.atc.Limp.IfThenElseStatement");
afterParserOrEnumRuleCall();
}
}
}
}
}
break;
case 3 :
// InternalLimp.g:2994:6: ()
{
// InternalLimp.g:2994:6: ()
// InternalLimp.g:2995:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getElseAccess().getNoElseAction_2(),
current);
}
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleElse"
// $ANTLR start "entryRuleWhileStatement"
// InternalLimp.g:3008:1: entryRuleWhileStatement returns [EObject current=null] : iv_ruleWhileStatement= ruleWhileStatement EOF ;
public final EObject entryRuleWhileStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleWhileStatement = null;
try {
// InternalLimp.g:3009:2: (iv_ruleWhileStatement= ruleWhileStatement EOF )
// InternalLimp.g:3010:2: iv_ruleWhileStatement= ruleWhileStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getWhileStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleWhileStatement=ruleWhileStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleWhileStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleWhileStatement"
// $ANTLR start "ruleWhileStatement"
// InternalLimp.g:3017:1: ruleWhileStatement returns [EObject current=null] : (otherlv_0= 'while' ( (lv_cond_1_0= ruleExpr ) ) ( (lv_block_2_0= ruleStatementBlock ) ) ) ;
public final EObject ruleWhileStatement() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
EObject lv_cond_1_0 = null;
EObject lv_block_2_0 = null;
enterRule();
try {
// InternalLimp.g:3020:28: ( (otherlv_0= 'while' ( (lv_cond_1_0= ruleExpr ) ) ( (lv_block_2_0= ruleStatementBlock ) ) ) )
// InternalLimp.g:3021:1: (otherlv_0= 'while' ( (lv_cond_1_0= ruleExpr ) ) ( (lv_block_2_0= ruleStatementBlock ) ) )
{
// InternalLimp.g:3021:1: (otherlv_0= 'while' ( (lv_cond_1_0= ruleExpr ) ) ( (lv_block_2_0= ruleStatementBlock ) ) )
// InternalLimp.g:3021:3: otherlv_0= 'while' ( (lv_cond_1_0= ruleExpr ) ) ( (lv_block_2_0= ruleStatementBlock ) )
{
otherlv_0=(Token)match(input,55,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getWhileStatementAccess().getWhileKeyword_0());
}
// InternalLimp.g:3025:1: ( (lv_cond_1_0= ruleExpr ) )
// InternalLimp.g:3026:1: (lv_cond_1_0= ruleExpr )
{
// InternalLimp.g:3026:1: (lv_cond_1_0= ruleExpr )
// InternalLimp.g:3027:3: lv_cond_1_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getWhileStatementAccess().getCondExprParserRuleCall_1_0());
}
pushFollow(FOLLOW_15);
lv_cond_1_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getWhileStatementRule());
}
set(
current,
"cond",
lv_cond_1_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:3043:2: ( (lv_block_2_0= ruleStatementBlock ) )
// InternalLimp.g:3044:1: (lv_block_2_0= ruleStatementBlock )
{
// InternalLimp.g:3044:1: (lv_block_2_0= ruleStatementBlock )
// InternalLimp.g:3045:3: lv_block_2_0= ruleStatementBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getWhileStatementAccess().getBlockStatementBlockParserRuleCall_2_0());
}
pushFollow(FOLLOW_2);
lv_block_2_0=ruleStatementBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getWhileStatementRule());
}
set(
current,
"block",
lv_block_2_0,
"com.rockwellcollins.atc.Limp.StatementBlock");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleWhileStatement"
// $ANTLR start "entryRuleForStatement"
// InternalLimp.g:3069:1: entryRuleForStatement returns [EObject current=null] : iv_ruleForStatement= ruleForStatement EOF ;
public final EObject entryRuleForStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleForStatement = null;
try {
// InternalLimp.g:3070:2: (iv_ruleForStatement= ruleForStatement EOF )
// InternalLimp.g:3071:2: iv_ruleForStatement= ruleForStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getForStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleForStatement=ruleForStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleForStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleForStatement"
// $ANTLR start "ruleForStatement"
// InternalLimp.g:3078:1: ruleForStatement returns [EObject current=null] : (otherlv_0= 'for' otherlv_1= '(' ( (lv_initStatement_2_0= ruleAssignmentStatement ) ) ( (lv_limitExpr_3_0= ruleExpr ) ) otherlv_4= ';' ( (lv_incrementStatement_5_0= ruleAssignmentStatement ) ) otherlv_6= ')' ( (lv_block_7_0= ruleStatementBlock ) ) ) ;
public final EObject ruleForStatement() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token otherlv_4=null;
Token otherlv_6=null;
EObject lv_initStatement_2_0 = null;
EObject lv_limitExpr_3_0 = null;
EObject lv_incrementStatement_5_0 = null;
EObject lv_block_7_0 = null;
enterRule();
try {
// InternalLimp.g:3081:28: ( (otherlv_0= 'for' otherlv_1= '(' ( (lv_initStatement_2_0= ruleAssignmentStatement ) ) ( (lv_limitExpr_3_0= ruleExpr ) ) otherlv_4= ';' ( (lv_incrementStatement_5_0= ruleAssignmentStatement ) ) otherlv_6= ')' ( (lv_block_7_0= ruleStatementBlock ) ) ) )
// InternalLimp.g:3082:1: (otherlv_0= 'for' otherlv_1= '(' ( (lv_initStatement_2_0= ruleAssignmentStatement ) ) ( (lv_limitExpr_3_0= ruleExpr ) ) otherlv_4= ';' ( (lv_incrementStatement_5_0= ruleAssignmentStatement ) ) otherlv_6= ')' ( (lv_block_7_0= ruleStatementBlock ) ) )
{
// InternalLimp.g:3082:1: (otherlv_0= 'for' otherlv_1= '(' ( (lv_initStatement_2_0= ruleAssignmentStatement ) ) ( (lv_limitExpr_3_0= ruleExpr ) ) otherlv_4= ';' ( (lv_incrementStatement_5_0= ruleAssignmentStatement ) ) otherlv_6= ')' ( (lv_block_7_0= ruleStatementBlock ) ) )
// InternalLimp.g:3082:3: otherlv_0= 'for' otherlv_1= '(' ( (lv_initStatement_2_0= ruleAssignmentStatement ) ) ( (lv_limitExpr_3_0= ruleExpr ) ) otherlv_4= ';' ( (lv_incrementStatement_5_0= ruleAssignmentStatement ) ) otherlv_6= ')' ( (lv_block_7_0= ruleStatementBlock ) )
{
otherlv_0=(Token)match(input,56,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getForStatementAccess().getForKeyword_0());
}
otherlv_1=(Token)match(input,17,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getForStatementAccess().getLeftParenthesisKeyword_1());
}
// InternalLimp.g:3090:1: ( (lv_initStatement_2_0= ruleAssignmentStatement ) )
// InternalLimp.g:3091:1: (lv_initStatement_2_0= ruleAssignmentStatement )
{
// InternalLimp.g:3091:1: (lv_initStatement_2_0= ruleAssignmentStatement )
// InternalLimp.g:3092:3: lv_initStatement_2_0= ruleAssignmentStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getForStatementAccess().getInitStatementAssignmentStatementParserRuleCall_2_0());
}
pushFollow(FOLLOW_32);
lv_initStatement_2_0=ruleAssignmentStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getForStatementRule());
}
set(
current,
"initStatement",
lv_initStatement_2_0,
"com.rockwellcollins.atc.Limp.AssignmentStatement");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:3108:2: ( (lv_limitExpr_3_0= ruleExpr ) )
// InternalLimp.g:3109:1: (lv_limitExpr_3_0= ruleExpr )
{
// InternalLimp.g:3109:1: (lv_limitExpr_3_0= ruleExpr )
// InternalLimp.g:3110:3: lv_limitExpr_3_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getForStatementAccess().getLimitExprExprParserRuleCall_3_0());
}
pushFollow(FOLLOW_34);
lv_limitExpr_3_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getForStatementRule());
}
set(
current,
"limitExpr",
lv_limitExpr_3_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_4=(Token)match(input,38,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getForStatementAccess().getSemicolonKeyword_4());
}
// InternalLimp.g:3130:1: ( (lv_incrementStatement_5_0= ruleAssignmentStatement ) )
// InternalLimp.g:3131:1: (lv_incrementStatement_5_0= ruleAssignmentStatement )
{
// InternalLimp.g:3131:1: (lv_incrementStatement_5_0= ruleAssignmentStatement )
// InternalLimp.g:3132:3: lv_incrementStatement_5_0= ruleAssignmentStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getForStatementAccess().getIncrementStatementAssignmentStatementParserRuleCall_5_0());
}
pushFollow(FOLLOW_9);
lv_incrementStatement_5_0=ruleAssignmentStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getForStatementRule());
}
set(
current,
"incrementStatement",
lv_incrementStatement_5_0,
"com.rockwellcollins.atc.Limp.AssignmentStatement");
afterParserOrEnumRuleCall();
}
}
}
otherlv_6=(Token)match(input,18,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getForStatementAccess().getRightParenthesisKeyword_6());
}
// InternalLimp.g:3152:1: ( (lv_block_7_0= ruleStatementBlock ) )
// InternalLimp.g:3153:1: (lv_block_7_0= ruleStatementBlock )
{
// InternalLimp.g:3153:1: (lv_block_7_0= ruleStatementBlock )
// InternalLimp.g:3154:3: lv_block_7_0= ruleStatementBlock
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getForStatementAccess().getBlockStatementBlockParserRuleCall_7_0());
}
pushFollow(FOLLOW_2);
lv_block_7_0=ruleStatementBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getForStatementRule());
}
set(
current,
"block",
lv_block_7_0,
"com.rockwellcollins.atc.Limp.StatementBlock");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleForStatement"
// $ANTLR start "entryRuleLabelStatement"
// InternalLimp.g:3178:1: entryRuleLabelStatement returns [EObject current=null] : iv_ruleLabelStatement= ruleLabelStatement EOF ;
public final EObject entryRuleLabelStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleLabelStatement = null;
try {
// InternalLimp.g:3179:2: (iv_ruleLabelStatement= ruleLabelStatement EOF )
// InternalLimp.g:3180:2: iv_ruleLabelStatement= ruleLabelStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getLabelStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleLabelStatement=ruleLabelStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleLabelStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleLabelStatement"
// $ANTLR start "ruleLabelStatement"
// InternalLimp.g:3187:1: ruleLabelStatement returns [EObject current=null] : (otherlv_0= 'label' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ';' ) ;
public final EObject ruleLabelStatement() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
Token otherlv_2=null;
enterRule();
try {
// InternalLimp.g:3190:28: ( (otherlv_0= 'label' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ';' ) )
// InternalLimp.g:3191:1: (otherlv_0= 'label' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ';' )
{
// InternalLimp.g:3191:1: (otherlv_0= 'label' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ';' )
// InternalLimp.g:3191:3: otherlv_0= 'label' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= ';'
{
otherlv_0=(Token)match(input,57,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getLabelStatementAccess().getLabelKeyword_0());
}
// InternalLimp.g:3195:1: ( (lv_name_1_0= RULE_ID ) )
// InternalLimp.g:3196:1: (lv_name_1_0= RULE_ID )
{
// InternalLimp.g:3196:1: (lv_name_1_0= RULE_ID )
// InternalLimp.g:3197:3: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_34); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_name_1_0, grammarAccess.getLabelStatementAccess().getNameIDTerminalRuleCall_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getLabelStatementRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_2=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getLabelStatementAccess().getSemicolonKeyword_2());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleLabelStatement"
// $ANTLR start "entryRuleGotoStatement"
// InternalLimp.g:3225:1: entryRuleGotoStatement returns [EObject current=null] : iv_ruleGotoStatement= ruleGotoStatement EOF ;
public final EObject entryRuleGotoStatement() throws RecognitionException {
EObject current = null;
EObject iv_ruleGotoStatement = null;
try {
// InternalLimp.g:3226:2: (iv_ruleGotoStatement= ruleGotoStatement EOF )
// InternalLimp.g:3227:2: iv_ruleGotoStatement= ruleGotoStatement EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getGotoStatementRule());
}
pushFollow(FOLLOW_1);
iv_ruleGotoStatement=ruleGotoStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleGotoStatement;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleGotoStatement"
// $ANTLR start "ruleGotoStatement"
// InternalLimp.g:3234:1: ruleGotoStatement returns [EObject current=null] : ( () otherlv_1= 'goto' ( (otherlv_2= RULE_ID ) ) (otherlv_3= 'when' ( (lv_whenExpr_4_0= ruleExpr ) ) )? otherlv_5= ';' ) ;
public final EObject ruleGotoStatement() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_2=null;
Token otherlv_3=null;
Token otherlv_5=null;
EObject lv_whenExpr_4_0 = null;
enterRule();
try {
// InternalLimp.g:3237:28: ( ( () otherlv_1= 'goto' ( (otherlv_2= RULE_ID ) ) (otherlv_3= 'when' ( (lv_whenExpr_4_0= ruleExpr ) ) )? otherlv_5= ';' ) )
// InternalLimp.g:3238:1: ( () otherlv_1= 'goto' ( (otherlv_2= RULE_ID ) ) (otherlv_3= 'when' ( (lv_whenExpr_4_0= ruleExpr ) ) )? otherlv_5= ';' )
{
// InternalLimp.g:3238:1: ( () otherlv_1= 'goto' ( (otherlv_2= RULE_ID ) ) (otherlv_3= 'when' ( (lv_whenExpr_4_0= ruleExpr ) ) )? otherlv_5= ';' )
// InternalLimp.g:3238:2: () otherlv_1= 'goto' ( (otherlv_2= RULE_ID ) ) (otherlv_3= 'when' ( (lv_whenExpr_4_0= ruleExpr ) ) )? otherlv_5= ';'
{
// InternalLimp.g:3238:2: ()
// InternalLimp.g:3239:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getGotoStatementAccess().getGotoStatementAction_0(),
current);
}
}
otherlv_1=(Token)match(input,58,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getGotoStatementAccess().getGotoKeyword_1());
}
// InternalLimp.g:3248:1: ( (otherlv_2= RULE_ID ) )
// InternalLimp.g:3249:1: (otherlv_2= RULE_ID )
{
// InternalLimp.g:3249:1: (otherlv_2= RULE_ID )
// InternalLimp.g:3250:3: otherlv_2= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getGotoStatementRule());
}
}
otherlv_2=(Token)match(input,RULE_ID,FOLLOW_41); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getGotoStatementAccess().getLabelLabelStatementCrossReference_2_0());
}
}
}
// InternalLimp.g:3261:2: (otherlv_3= 'when' ( (lv_whenExpr_4_0= ruleExpr ) ) )?
int alt22=2;
int LA22_0 = input.LA(1);
if ( (LA22_0==59) ) {
alt22=1;
}
switch (alt22) {
case 1 :
// InternalLimp.g:3261:4: otherlv_3= 'when' ( (lv_whenExpr_4_0= ruleExpr ) )
{
otherlv_3=(Token)match(input,59,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getGotoStatementAccess().getWhenKeyword_3_0());
}
// InternalLimp.g:3265:1: ( (lv_whenExpr_4_0= ruleExpr ) )
// InternalLimp.g:3266:1: (lv_whenExpr_4_0= ruleExpr )
{
// InternalLimp.g:3266:1: (lv_whenExpr_4_0= ruleExpr )
// InternalLimp.g:3267:3: lv_whenExpr_4_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getGotoStatementAccess().getWhenExprExprParserRuleCall_3_1_0());
}
pushFollow(FOLLOW_34);
lv_whenExpr_4_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getGotoStatementRule());
}
set(
current,
"whenExpr",
lv_whenExpr_4_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
otherlv_5=(Token)match(input,38,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getGotoStatementAccess().getSemicolonKeyword_4());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleGotoStatement"
// $ANTLR start "entryRuleEquationBlock"
// InternalLimp.g:3295:1: entryRuleEquationBlock returns [EObject current=null] : iv_ruleEquationBlock= ruleEquationBlock EOF ;
public final EObject entryRuleEquationBlock() throws RecognitionException {
EObject current = null;
EObject iv_ruleEquationBlock = null;
try {
// InternalLimp.g:3296:2: (iv_ruleEquationBlock= ruleEquationBlock EOF )
// InternalLimp.g:3297:2: iv_ruleEquationBlock= ruleEquationBlock EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEquationBlockRule());
}
pushFollow(FOLLOW_1);
iv_ruleEquationBlock=ruleEquationBlock();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleEquationBlock;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleEquationBlock"
// $ANTLR start "ruleEquationBlock"
// InternalLimp.g:3304:1: ruleEquationBlock returns [EObject current=null] : ( () otherlv_1= '{' ( (lv_equations_2_0= ruleEquation ) )* otherlv_3= '}' ) ;
public final EObject ruleEquationBlock() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
EObject lv_equations_2_0 = null;
enterRule();
try {
// InternalLimp.g:3307:28: ( ( () otherlv_1= '{' ( (lv_equations_2_0= ruleEquation ) )* otherlv_3= '}' ) )
// InternalLimp.g:3308:1: ( () otherlv_1= '{' ( (lv_equations_2_0= ruleEquation ) )* otherlv_3= '}' )
{
// InternalLimp.g:3308:1: ( () otherlv_1= '{' ( (lv_equations_2_0= ruleEquation ) )* otherlv_3= '}' )
// InternalLimp.g:3308:2: () otherlv_1= '{' ( (lv_equations_2_0= ruleEquation ) )* otherlv_3= '}'
{
// InternalLimp.g:3308:2: ()
// InternalLimp.g:3309:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getEquationBlockAccess().getEquationBlockAction_0(),
current);
}
}
otherlv_1=(Token)match(input,26,FOLLOW_42); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getEquationBlockAccess().getLeftCurlyBracketKeyword_1());
}
// InternalLimp.g:3318:1: ( (lv_equations_2_0= ruleEquation ) )*
loop23:
do {
int alt23=2;
int LA23_0 = input.LA(1);
if ( ((LA23_0>=RULE_STRING && LA23_0<=RULE_REAL)||LA23_0==17||(LA23_0>=30 && LA23_0<=31)||LA23_0==61||(LA23_0>=72 && LA23_0<=73)||LA23_0==75||(LA23_0>=78 && LA23_0<=79)) ) {
alt23=1;
}
switch (alt23) {
case 1 :
// InternalLimp.g:3319:1: (lv_equations_2_0= ruleEquation )
{
// InternalLimp.g:3319:1: (lv_equations_2_0= ruleEquation )
// InternalLimp.g:3320:3: lv_equations_2_0= ruleEquation
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEquationBlockAccess().getEquationsEquationParserRuleCall_2_0());
}
pushFollow(FOLLOW_42);
lv_equations_2_0=ruleEquation();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getEquationBlockRule());
}
add(
current,
"equations",
lv_equations_2_0,
"com.rockwellcollins.atc.Limp.Equation");
afterParserOrEnumRuleCall();
}
}
}
break;
default :
break loop23;
}
} while (true);
otherlv_3=(Token)match(input,27,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getEquationBlockAccess().getRightCurlyBracketKeyword_3());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleEquationBlock"
// $ANTLR start "entryRuleEquation"
// InternalLimp.g:3348:1: entryRuleEquation returns [EObject current=null] : iv_ruleEquation= ruleEquation EOF ;
public final EObject entryRuleEquation() throws RecognitionException {
EObject current = null;
EObject iv_ruleEquation = null;
try {
// InternalLimp.g:3349:2: (iv_ruleEquation= ruleEquation EOF )
// InternalLimp.g:3350:2: iv_ruleEquation= ruleEquation EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEquationRule());
}
pushFollow(FOLLOW_1);
iv_ruleEquation=ruleEquation();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleEquation;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleEquation"
// $ANTLR start "ruleEquation"
// InternalLimp.g:3357:1: ruleEquation returns [EObject current=null] : (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement ) ;
public final EObject ruleEquation() throws RecognitionException {
EObject current = null;
EObject this_VoidStatement_0 = null;
EObject this_AssignmentStatement_1 = null;
enterRule();
try {
// InternalLimp.g:3360:28: ( (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement ) )
// InternalLimp.g:3361:1: (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement )
{
// InternalLimp.g:3361:1: (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement )
int alt24=2;
int LA24_0 = input.LA(1);
if ( (LA24_0==RULE_STRING||(LA24_0>=RULE_INT && LA24_0<=RULE_REAL)||LA24_0==17||(LA24_0>=30 && LA24_0<=31)||LA24_0==61||(LA24_0>=72 && LA24_0<=73)||LA24_0==75||(LA24_0>=78 && LA24_0<=79)) ) {
alt24=1;
}
else if ( (LA24_0==RULE_ID) ) {
int LA24_2 = input.LA(2);
if ( (LA24_2==17||LA24_2==26||LA24_2==32||LA24_2==38||LA24_2==60||(LA24_2>=62 && LA24_2<=74)||LA24_2==76) ) {
alt24=1;
}
else if ( (LA24_2==24||LA24_2==29) ) {
alt24=2;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 24, 2, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 24, 0, input);
throw nvae;
}
switch (alt24) {
case 1 :
// InternalLimp.g:3362:5: this_VoidStatement_0= ruleVoidStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEquationAccess().getVoidStatementParserRuleCall_0());
}
pushFollow(FOLLOW_2);
this_VoidStatement_0=ruleVoidStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_VoidStatement_0;
afterParserOrEnumRuleCall();
}
}
break;
case 2 :
// InternalLimp.g:3372:5: this_AssignmentStatement_1= ruleAssignmentStatement
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getEquationAccess().getAssignmentStatementParserRuleCall_1());
}
pushFollow(FOLLOW_2);
this_AssignmentStatement_1=ruleAssignmentStatement();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_AssignmentStatement_1;
afterParserOrEnumRuleCall();
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleEquation"
// $ANTLR start "entryRuleIdList"
// InternalLimp.g:3388:1: entryRuleIdList returns [EObject current=null] : iv_ruleIdList= ruleIdList EOF ;
public final EObject entryRuleIdList() throws RecognitionException {
EObject current = null;
EObject iv_ruleIdList = null;
try {
// InternalLimp.g:3389:2: (iv_ruleIdList= ruleIdList EOF )
// InternalLimp.g:3390:2: iv_ruleIdList= ruleIdList EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIdListRule());
}
pushFollow(FOLLOW_1);
iv_ruleIdList=ruleIdList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleIdList;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleIdList"
// $ANTLR start "ruleIdList"
// InternalLimp.g:3397:1: ruleIdList returns [EObject current=null] : ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* ) ;
public final EObject ruleIdList() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token otherlv_2=null;
enterRule();
try {
// InternalLimp.g:3400:28: ( ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* ) )
// InternalLimp.g:3401:1: ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* )
{
// InternalLimp.g:3401:1: ( ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )* )
// InternalLimp.g:3401:2: ( (otherlv_0= RULE_ID ) ) (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )*
{
// InternalLimp.g:3401:2: ( (otherlv_0= RULE_ID ) )
// InternalLimp.g:3402:1: (otherlv_0= RULE_ID )
{
// InternalLimp.g:3402:1: (otherlv_0= RULE_ID )
// InternalLimp.g:3403:3: otherlv_0= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getIdListRule());
}
}
otherlv_0=(Token)match(input,RULE_ID,FOLLOW_33); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getIdListAccess().getIdsVariableRefCrossReference_0_0());
}
}
}
// InternalLimp.g:3414:2: (otherlv_1= ',' ( (otherlv_2= RULE_ID ) ) )*
loop25:
do {
int alt25=2;
int LA25_0 = input.LA(1);
if ( (LA25_0==29) ) {
alt25=1;
}
switch (alt25) {
case 1 :
// InternalLimp.g:3414:4: otherlv_1= ',' ( (otherlv_2= RULE_ID ) )
{
otherlv_1=(Token)match(input,29,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getIdListAccess().getCommaKeyword_1_0());
}
// InternalLimp.g:3418:1: ( (otherlv_2= RULE_ID ) )
// InternalLimp.g:3419:1: (otherlv_2= RULE_ID )
{
// InternalLimp.g:3419:1: (otherlv_2= RULE_ID )
// InternalLimp.g:3420:3: otherlv_2= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getIdListRule());
}
}
otherlv_2=(Token)match(input,RULE_ID,FOLLOW_33); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getIdListAccess().getIdsVariableRefCrossReference_1_1_0());
}
}
}
}
break;
default :
break loop25;
}
} while (true);
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleIdList"
// $ANTLR start "entryRuleExpr"
// InternalLimp.g:3439:1: entryRuleExpr returns [EObject current=null] : iv_ruleExpr= ruleExpr EOF ;
public final EObject entryRuleExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleExpr = null;
try {
// InternalLimp.g:3440:2: (iv_ruleExpr= ruleExpr EOF )
// InternalLimp.g:3441:2: iv_ruleExpr= ruleExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleExpr=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleExpr"
// $ANTLR start "ruleExpr"
// InternalLimp.g:3448:1: ruleExpr returns [EObject current=null] : this_IfThenElseExpr_0= ruleIfThenElseExpr ;
public final EObject ruleExpr() throws RecognitionException {
EObject current = null;
EObject this_IfThenElseExpr_0 = null;
enterRule();
try {
// InternalLimp.g:3451:28: (this_IfThenElseExpr_0= ruleIfThenElseExpr )
// InternalLimp.g:3453:5: this_IfThenElseExpr_0= ruleIfThenElseExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExprAccess().getIfThenElseExprParserRuleCall());
}
pushFollow(FOLLOW_2);
this_IfThenElseExpr_0=ruleIfThenElseExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_IfThenElseExpr_0;
afterParserOrEnumRuleCall();
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleExpr"
// $ANTLR start "entryRuleIfThenElseExpr"
// InternalLimp.g:3469:1: entryRuleIfThenElseExpr returns [EObject current=null] : iv_ruleIfThenElseExpr= ruleIfThenElseExpr EOF ;
public final EObject entryRuleIfThenElseExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleIfThenElseExpr = null;
try {
// InternalLimp.g:3470:2: (iv_ruleIfThenElseExpr= ruleIfThenElseExpr EOF )
// InternalLimp.g:3471:2: iv_ruleIfThenElseExpr= ruleIfThenElseExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleIfThenElseExpr=ruleIfThenElseExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleIfThenElseExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleIfThenElseExpr"
// $ANTLR start "ruleIfThenElseExpr"
// InternalLimp.g:3478:1: ruleIfThenElseExpr returns [EObject current=null] : (this_ChoiceExpr_0= ruleChoiceExpr ( ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) ) ( (lv_thenExpr_3_0= ruleExpr ) ) otherlv_4= ':' ( (lv_elseExpr_5_0= ruleExpr ) ) )? ) ;
public final EObject ruleIfThenElseExpr() throws RecognitionException {
EObject current = null;
Token otherlv_2=null;
Token otherlv_4=null;
EObject this_ChoiceExpr_0 = null;
EObject lv_thenExpr_3_0 = null;
EObject lv_elseExpr_5_0 = null;
enterRule();
try {
// InternalLimp.g:3481:28: ( (this_ChoiceExpr_0= ruleChoiceExpr ( ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) ) ( (lv_thenExpr_3_0= ruleExpr ) ) otherlv_4= ':' ( (lv_elseExpr_5_0= ruleExpr ) ) )? ) )
// InternalLimp.g:3482:1: (this_ChoiceExpr_0= ruleChoiceExpr ( ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) ) ( (lv_thenExpr_3_0= ruleExpr ) ) otherlv_4= ':' ( (lv_elseExpr_5_0= ruleExpr ) ) )? )
{
// InternalLimp.g:3482:1: (this_ChoiceExpr_0= ruleChoiceExpr ( ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) ) ( (lv_thenExpr_3_0= ruleExpr ) ) otherlv_4= ':' ( (lv_elseExpr_5_0= ruleExpr ) ) )? )
// InternalLimp.g:3483:5: this_ChoiceExpr_0= ruleChoiceExpr ( ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) ) ( (lv_thenExpr_3_0= ruleExpr ) ) otherlv_4= ':' ( (lv_elseExpr_5_0= ruleExpr ) ) )?
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseExprAccess().getChoiceExprParserRuleCall_0());
}
pushFollow(FOLLOW_43);
this_ChoiceExpr_0=ruleChoiceExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ChoiceExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:3491:1: ( ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) ) ( (lv_thenExpr_3_0= ruleExpr ) ) otherlv_4= ':' ( (lv_elseExpr_5_0= ruleExpr ) ) )?
int alt26=2;
int LA26_0 = input.LA(1);
if ( (LA26_0==60) && (synpred1_InternalLimp())) {
alt26=1;
}
switch (alt26) {
case 1 :
// InternalLimp.g:3491:2: ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) ) ( (lv_thenExpr_3_0= ruleExpr ) ) otherlv_4= ':' ( (lv_elseExpr_5_0= ruleExpr ) )
{
// InternalLimp.g:3491:2: ( ( ( () '?' ) )=> ( () otherlv_2= '?' ) )
// InternalLimp.g:3491:3: ( ( () '?' ) )=> ( () otherlv_2= '?' )
{
// InternalLimp.g:3493:5: ( () otherlv_2= '?' )
// InternalLimp.g:3493:6: () otherlv_2= '?'
{
// InternalLimp.g:3493:6: ()
// InternalLimp.g:3494:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getIfThenElseExprAccess().getIfThenElseExprCondExprAction_1_0_0_0(),
current);
}
}
otherlv_2=(Token)match(input,60,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getIfThenElseExprAccess().getQuestionMarkKeyword_1_0_0_1());
}
}
}
// InternalLimp.g:3503:3: ( (lv_thenExpr_3_0= ruleExpr ) )
// InternalLimp.g:3504:1: (lv_thenExpr_3_0= ruleExpr )
{
// InternalLimp.g:3504:1: (lv_thenExpr_3_0= ruleExpr )
// InternalLimp.g:3505:3: lv_thenExpr_3_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseExprAccess().getThenExprExprParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_30);
lv_thenExpr_3_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getIfThenElseExprRule());
}
set(
current,
"thenExpr",
lv_thenExpr_3_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_4=(Token)match(input,35,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getIfThenElseExprAccess().getColonKeyword_1_2());
}
// InternalLimp.g:3525:1: ( (lv_elseExpr_5_0= ruleExpr ) )
// InternalLimp.g:3526:1: (lv_elseExpr_5_0= ruleExpr )
{
// InternalLimp.g:3526:1: (lv_elseExpr_5_0= ruleExpr )
// InternalLimp.g:3527:3: lv_elseExpr_5_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getIfThenElseExprAccess().getElseExprExprParserRuleCall_1_3_0());
}
pushFollow(FOLLOW_2);
lv_elseExpr_5_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getIfThenElseExprRule());
}
set(
current,
"elseExpr",
lv_elseExpr_5_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleIfThenElseExpr"
// $ANTLR start "entryRuleChoiceExpr"
// InternalLimp.g:3551:1: entryRuleChoiceExpr returns [EObject current=null] : iv_ruleChoiceExpr= ruleChoiceExpr EOF ;
public final EObject entryRuleChoiceExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleChoiceExpr = null;
try {
// InternalLimp.g:3552:2: (iv_ruleChoiceExpr= ruleChoiceExpr EOF )
// InternalLimp.g:3553:2: iv_ruleChoiceExpr= ruleChoiceExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getChoiceExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleChoiceExpr=ruleChoiceExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleChoiceExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleChoiceExpr"
// $ANTLR start "ruleChoiceExpr"
// InternalLimp.g:3560:1: ruleChoiceExpr returns [EObject current=null] : ( ( () otherlv_1= 'choice' otherlv_2= '(' ( (lv_first_3_0= ruleExpr ) ) otherlv_4= ',' ( (lv_second_5_0= ruleExpr ) ) otherlv_6= ')' ) | this_ImpliesExpr_7= ruleImpliesExpr ) ;
public final EObject ruleChoiceExpr() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_2=null;
Token otherlv_4=null;
Token otherlv_6=null;
EObject lv_first_3_0 = null;
EObject lv_second_5_0 = null;
EObject this_ImpliesExpr_7 = null;
enterRule();
try {
// InternalLimp.g:3563:28: ( ( ( () otherlv_1= 'choice' otherlv_2= '(' ( (lv_first_3_0= ruleExpr ) ) otherlv_4= ',' ( (lv_second_5_0= ruleExpr ) ) otherlv_6= ')' ) | this_ImpliesExpr_7= ruleImpliesExpr ) )
// InternalLimp.g:3564:1: ( ( () otherlv_1= 'choice' otherlv_2= '(' ( (lv_first_3_0= ruleExpr ) ) otherlv_4= ',' ( (lv_second_5_0= ruleExpr ) ) otherlv_6= ')' ) | this_ImpliesExpr_7= ruleImpliesExpr )
{
// InternalLimp.g:3564:1: ( ( () otherlv_1= 'choice' otherlv_2= '(' ( (lv_first_3_0= ruleExpr ) ) otherlv_4= ',' ( (lv_second_5_0= ruleExpr ) ) otherlv_6= ')' ) | this_ImpliesExpr_7= ruleImpliesExpr )
int alt27=2;
int LA27_0 = input.LA(1);
if ( (LA27_0==61) ) {
alt27=1;
}
else if ( ((LA27_0>=RULE_STRING && LA27_0<=RULE_REAL)||LA27_0==17||(LA27_0>=30 && LA27_0<=31)||(LA27_0>=72 && LA27_0<=73)||LA27_0==75||(LA27_0>=78 && LA27_0<=79)) ) {
alt27=2;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 27, 0, input);
throw nvae;
}
switch (alt27) {
case 1 :
// InternalLimp.g:3564:2: ( () otherlv_1= 'choice' otherlv_2= '(' ( (lv_first_3_0= ruleExpr ) ) otherlv_4= ',' ( (lv_second_5_0= ruleExpr ) ) otherlv_6= ')' )
{
// InternalLimp.g:3564:2: ( () otherlv_1= 'choice' otherlv_2= '(' ( (lv_first_3_0= ruleExpr ) ) otherlv_4= ',' ( (lv_second_5_0= ruleExpr ) ) otherlv_6= ')' )
// InternalLimp.g:3564:3: () otherlv_1= 'choice' otherlv_2= '(' ( (lv_first_3_0= ruleExpr ) ) otherlv_4= ',' ( (lv_second_5_0= ruleExpr ) ) otherlv_6= ')'
{
// InternalLimp.g:3564:3: ()
// InternalLimp.g:3565:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getChoiceExprAccess().getChoiceExprAction_0_0(),
current);
}
}
otherlv_1=(Token)match(input,61,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getChoiceExprAccess().getChoiceKeyword_0_1());
}
otherlv_2=(Token)match(input,17,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getChoiceExprAccess().getLeftParenthesisKeyword_0_2());
}
// InternalLimp.g:3578:1: ( (lv_first_3_0= ruleExpr ) )
// InternalLimp.g:3579:1: (lv_first_3_0= ruleExpr )
{
// InternalLimp.g:3579:1: (lv_first_3_0= ruleExpr )
// InternalLimp.g:3580:3: lv_first_3_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getChoiceExprAccess().getFirstExprParserRuleCall_0_3_0());
}
pushFollow(FOLLOW_44);
lv_first_3_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getChoiceExprRule());
}
set(
current,
"first",
lv_first_3_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_4=(Token)match(input,29,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getChoiceExprAccess().getCommaKeyword_0_4());
}
// InternalLimp.g:3600:1: ( (lv_second_5_0= ruleExpr ) )
// InternalLimp.g:3601:1: (lv_second_5_0= ruleExpr )
{
// InternalLimp.g:3601:1: (lv_second_5_0= ruleExpr )
// InternalLimp.g:3602:3: lv_second_5_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getChoiceExprAccess().getSecondExprParserRuleCall_0_5_0());
}
pushFollow(FOLLOW_9);
lv_second_5_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getChoiceExprRule());
}
set(
current,
"second",
lv_second_5_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_6=(Token)match(input,18,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getChoiceExprAccess().getRightParenthesisKeyword_0_6());
}
}
}
break;
case 2 :
// InternalLimp.g:3624:5: this_ImpliesExpr_7= ruleImpliesExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getChoiceExprAccess().getImpliesExprParserRuleCall_1());
}
pushFollow(FOLLOW_2);
this_ImpliesExpr_7=ruleImpliesExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ImpliesExpr_7;
afterParserOrEnumRuleCall();
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleChoiceExpr"
// $ANTLR start "entryRuleImpliesExpr"
// InternalLimp.g:3640:1: entryRuleImpliesExpr returns [EObject current=null] : iv_ruleImpliesExpr= ruleImpliesExpr EOF ;
public final EObject entryRuleImpliesExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleImpliesExpr = null;
try {
// InternalLimp.g:3641:2: (iv_ruleImpliesExpr= ruleImpliesExpr EOF )
// InternalLimp.g:3642:2: iv_ruleImpliesExpr= ruleImpliesExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getImpliesExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleImpliesExpr=ruleImpliesExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleImpliesExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleImpliesExpr"
// $ANTLR start "ruleImpliesExpr"
// InternalLimp.g:3649:1: ruleImpliesExpr returns [EObject current=null] : (this_OrExpr_0= ruleOrExpr ( ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) ) ( (lv_right_3_0= ruleImpliesExpr ) ) )? ) ;
public final EObject ruleImpliesExpr() throws RecognitionException {
EObject current = null;
Token lv_op_2_0=null;
EObject this_OrExpr_0 = null;
EObject lv_right_3_0 = null;
enterRule();
try {
// InternalLimp.g:3652:28: ( (this_OrExpr_0= ruleOrExpr ( ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) ) ( (lv_right_3_0= ruleImpliesExpr ) ) )? ) )
// InternalLimp.g:3653:1: (this_OrExpr_0= ruleOrExpr ( ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) ) ( (lv_right_3_0= ruleImpliesExpr ) ) )? )
{
// InternalLimp.g:3653:1: (this_OrExpr_0= ruleOrExpr ( ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) ) ( (lv_right_3_0= ruleImpliesExpr ) ) )? )
// InternalLimp.g:3654:5: this_OrExpr_0= ruleOrExpr ( ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) ) ( (lv_right_3_0= ruleImpliesExpr ) ) )?
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getImpliesExprAccess().getOrExprParserRuleCall_0());
}
pushFollow(FOLLOW_45);
this_OrExpr_0=ruleOrExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_OrExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:3662:1: ( ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) ) ( (lv_right_3_0= ruleImpliesExpr ) ) )?
int alt28=2;
int LA28_0 = input.LA(1);
if ( (LA28_0==62) && (synpred2_InternalLimp())) {
alt28=1;
}
switch (alt28) {
case 1 :
// InternalLimp.g:3662:2: ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) ) ( (lv_right_3_0= ruleImpliesExpr ) )
{
// InternalLimp.g:3662:2: ( ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) ) )
// InternalLimp.g:3662:3: ( ( () ( ( '=>' ) ) ) )=> ( () ( (lv_op_2_0= '=>' ) ) )
{
// InternalLimp.g:3669:6: ( () ( (lv_op_2_0= '=>' ) ) )
// InternalLimp.g:3669:7: () ( (lv_op_2_0= '=>' ) )
{
// InternalLimp.g:3669:7: ()
// InternalLimp.g:3670:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getImpliesExprAccess().getBinaryExprLeftAction_1_0_0_0(),
current);
}
}
// InternalLimp.g:3675:2: ( (lv_op_2_0= '=>' ) )
// InternalLimp.g:3676:1: (lv_op_2_0= '=>' )
{
// InternalLimp.g:3676:1: (lv_op_2_0= '=>' )
// InternalLimp.g:3677:3: lv_op_2_0= '=>'
{
lv_op_2_0=(Token)match(input,62,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_op_2_0, grammarAccess.getImpliesExprAccess().getOpEqualsSignGreaterThanSignKeyword_1_0_0_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getImpliesExprRule());
}
setWithLastConsumed(current, "op", lv_op_2_0, "=>");
}
}
}
}
}
// InternalLimp.g:3690:4: ( (lv_right_3_0= ruleImpliesExpr ) )
// InternalLimp.g:3691:1: (lv_right_3_0= ruleImpliesExpr )
{
// InternalLimp.g:3691:1: (lv_right_3_0= ruleImpliesExpr )
// InternalLimp.g:3692:3: lv_right_3_0= ruleImpliesExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getImpliesExprAccess().getRightImpliesExprParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_2);
lv_right_3_0=ruleImpliesExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getImpliesExprRule());
}
set(
current,
"right",
lv_right_3_0,
"com.rockwellcollins.atc.Limp.ImpliesExpr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleImpliesExpr"
// $ANTLR start "entryRuleOrExpr"
// InternalLimp.g:3716:1: entryRuleOrExpr returns [EObject current=null] : iv_ruleOrExpr= ruleOrExpr EOF ;
public final EObject entryRuleOrExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleOrExpr = null;
try {
// InternalLimp.g:3717:2: (iv_ruleOrExpr= ruleOrExpr EOF )
// InternalLimp.g:3718:2: iv_ruleOrExpr= ruleOrExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOrExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleOrExpr=ruleOrExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleOrExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleOrExpr"
// $ANTLR start "ruleOrExpr"
// InternalLimp.g:3725:1: ruleOrExpr returns [EObject current=null] : (this_AndExpr_0= ruleAndExpr ( ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) ) ( (lv_right_3_0= ruleAndExpr ) ) )* ) ;
public final EObject ruleOrExpr() throws RecognitionException {
EObject current = null;
Token lv_op_2_0=null;
EObject this_AndExpr_0 = null;
EObject lv_right_3_0 = null;
enterRule();
try {
// InternalLimp.g:3728:28: ( (this_AndExpr_0= ruleAndExpr ( ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) ) ( (lv_right_3_0= ruleAndExpr ) ) )* ) )
// InternalLimp.g:3729:1: (this_AndExpr_0= ruleAndExpr ( ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) ) ( (lv_right_3_0= ruleAndExpr ) ) )* )
{
// InternalLimp.g:3729:1: (this_AndExpr_0= ruleAndExpr ( ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) ) ( (lv_right_3_0= ruleAndExpr ) ) )* )
// InternalLimp.g:3730:5: this_AndExpr_0= ruleAndExpr ( ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) ) ( (lv_right_3_0= ruleAndExpr ) ) )*
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOrExprAccess().getAndExprParserRuleCall_0());
}
pushFollow(FOLLOW_46);
this_AndExpr_0=ruleAndExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_AndExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:3738:1: ( ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) ) ( (lv_right_3_0= ruleAndExpr ) ) )*
loop29:
do {
int alt29=2;
int LA29_0 = input.LA(1);
if ( (LA29_0==63) && (synpred3_InternalLimp())) {
alt29=1;
}
switch (alt29) {
case 1 :
// InternalLimp.g:3738:2: ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) ) ( (lv_right_3_0= ruleAndExpr ) )
{
// InternalLimp.g:3738:2: ( ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) ) )
// InternalLimp.g:3738:3: ( ( () ( ( 'or' ) ) ) )=> ( () ( (lv_op_2_0= 'or' ) ) )
{
// InternalLimp.g:3745:6: ( () ( (lv_op_2_0= 'or' ) ) )
// InternalLimp.g:3745:7: () ( (lv_op_2_0= 'or' ) )
{
// InternalLimp.g:3745:7: ()
// InternalLimp.g:3746:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getOrExprAccess().getBinaryExprLeftAction_1_0_0_0(),
current);
}
}
// InternalLimp.g:3751:2: ( (lv_op_2_0= 'or' ) )
// InternalLimp.g:3752:1: (lv_op_2_0= 'or' )
{
// InternalLimp.g:3752:1: (lv_op_2_0= 'or' )
// InternalLimp.g:3753:3: lv_op_2_0= 'or'
{
lv_op_2_0=(Token)match(input,63,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_op_2_0, grammarAccess.getOrExprAccess().getOpOrKeyword_1_0_0_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getOrExprRule());
}
setWithLastConsumed(current, "op", lv_op_2_0, "or");
}
}
}
}
}
// InternalLimp.g:3766:4: ( (lv_right_3_0= ruleAndExpr ) )
// InternalLimp.g:3767:1: (lv_right_3_0= ruleAndExpr )
{
// InternalLimp.g:3767:1: (lv_right_3_0= ruleAndExpr )
// InternalLimp.g:3768:3: lv_right_3_0= ruleAndExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getOrExprAccess().getRightAndExprParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_46);
lv_right_3_0=ruleAndExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getOrExprRule());
}
set(
current,
"right",
lv_right_3_0,
"com.rockwellcollins.atc.Limp.AndExpr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop29;
}
} while (true);
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleOrExpr"
// $ANTLR start "entryRuleAndExpr"
// InternalLimp.g:3792:1: entryRuleAndExpr returns [EObject current=null] : iv_ruleAndExpr= ruleAndExpr EOF ;
public final EObject entryRuleAndExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleAndExpr = null;
try {
// InternalLimp.g:3793:2: (iv_ruleAndExpr= ruleAndExpr EOF )
// InternalLimp.g:3794:2: iv_ruleAndExpr= ruleAndExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAndExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleAndExpr=ruleAndExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleAndExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleAndExpr"
// $ANTLR start "ruleAndExpr"
// InternalLimp.g:3801:1: ruleAndExpr returns [EObject current=null] : (this_RelationalExpr_0= ruleRelationalExpr ( ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) ) ( (lv_right_3_0= ruleRelationalExpr ) ) )* ) ;
public final EObject ruleAndExpr() throws RecognitionException {
EObject current = null;
Token lv_op_2_0=null;
EObject this_RelationalExpr_0 = null;
EObject lv_right_3_0 = null;
enterRule();
try {
// InternalLimp.g:3804:28: ( (this_RelationalExpr_0= ruleRelationalExpr ( ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) ) ( (lv_right_3_0= ruleRelationalExpr ) ) )* ) )
// InternalLimp.g:3805:1: (this_RelationalExpr_0= ruleRelationalExpr ( ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) ) ( (lv_right_3_0= ruleRelationalExpr ) ) )* )
{
// InternalLimp.g:3805:1: (this_RelationalExpr_0= ruleRelationalExpr ( ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) ) ( (lv_right_3_0= ruleRelationalExpr ) ) )* )
// InternalLimp.g:3806:5: this_RelationalExpr_0= ruleRelationalExpr ( ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) ) ( (lv_right_3_0= ruleRelationalExpr ) ) )*
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAndExprAccess().getRelationalExprParserRuleCall_0());
}
pushFollow(FOLLOW_47);
this_RelationalExpr_0=ruleRelationalExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_RelationalExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:3814:1: ( ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) ) ( (lv_right_3_0= ruleRelationalExpr ) ) )*
loop30:
do {
int alt30=2;
int LA30_0 = input.LA(1);
if ( (LA30_0==64) && (synpred4_InternalLimp())) {
alt30=1;
}
switch (alt30) {
case 1 :
// InternalLimp.g:3814:2: ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) ) ( (lv_right_3_0= ruleRelationalExpr ) )
{
// InternalLimp.g:3814:2: ( ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) ) )
// InternalLimp.g:3814:3: ( ( () ( ( 'and' ) ) ) )=> ( () ( (lv_op_2_0= 'and' ) ) )
{
// InternalLimp.g:3821:6: ( () ( (lv_op_2_0= 'and' ) ) )
// InternalLimp.g:3821:7: () ( (lv_op_2_0= 'and' ) )
{
// InternalLimp.g:3821:7: ()
// InternalLimp.g:3822:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getAndExprAccess().getBinaryExprLeftAction_1_0_0_0(),
current);
}
}
// InternalLimp.g:3827:2: ( (lv_op_2_0= 'and' ) )
// InternalLimp.g:3828:1: (lv_op_2_0= 'and' )
{
// InternalLimp.g:3828:1: (lv_op_2_0= 'and' )
// InternalLimp.g:3829:3: lv_op_2_0= 'and'
{
lv_op_2_0=(Token)match(input,64,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_op_2_0, grammarAccess.getAndExprAccess().getOpAndKeyword_1_0_0_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getAndExprRule());
}
setWithLastConsumed(current, "op", lv_op_2_0, "and");
}
}
}
}
}
// InternalLimp.g:3842:4: ( (lv_right_3_0= ruleRelationalExpr ) )
// InternalLimp.g:3843:1: (lv_right_3_0= ruleRelationalExpr )
{
// InternalLimp.g:3843:1: (lv_right_3_0= ruleRelationalExpr )
// InternalLimp.g:3844:3: lv_right_3_0= ruleRelationalExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAndExprAccess().getRightRelationalExprParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_47);
lv_right_3_0=ruleRelationalExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getAndExprRule());
}
set(
current,
"right",
lv_right_3_0,
"com.rockwellcollins.atc.Limp.RelationalExpr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop30;
}
} while (true);
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleAndExpr"
// $ANTLR start "entryRuleRelationalOp"
// InternalLimp.g:3868:1: entryRuleRelationalOp returns [String current=null] : iv_ruleRelationalOp= ruleRelationalOp EOF ;
public final String entryRuleRelationalOp() throws RecognitionException {
String current = null;
AntlrDatatypeRuleToken iv_ruleRelationalOp = null;
try {
// InternalLimp.g:3869:2: (iv_ruleRelationalOp= ruleRelationalOp EOF )
// InternalLimp.g:3870:2: iv_ruleRelationalOp= ruleRelationalOp EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRelationalOpRule());
}
pushFollow(FOLLOW_1);
iv_ruleRelationalOp=ruleRelationalOp();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleRelationalOp.getText();
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRelationalOp"
// $ANTLR start "ruleRelationalOp"
// InternalLimp.g:3877:1: ruleRelationalOp returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= '<' | kw= '<=' | kw= '>' | kw= '>=' | kw= '==' | kw= '<>' ) ;
public final AntlrDatatypeRuleToken ruleRelationalOp() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
Token kw=null;
enterRule();
try {
// InternalLimp.g:3880:28: ( (kw= '<' | kw= '<=' | kw= '>' | kw= '>=' | kw= '==' | kw= '<>' ) )
// InternalLimp.g:3881:1: (kw= '<' | kw= '<=' | kw= '>' | kw= '>=' | kw= '==' | kw= '<>' )
{
// InternalLimp.g:3881:1: (kw= '<' | kw= '<=' | kw= '>' | kw= '>=' | kw= '==' | kw= '<>' )
int alt31=6;
switch ( input.LA(1) ) {
case 65:
{
alt31=1;
}
break;
case 66:
{
alt31=2;
}
break;
case 67:
{
alt31=3;
}
break;
case 68:
{
alt31=4;
}
break;
case 69:
{
alt31=5;
}
break;
case 70:
{
alt31=6;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 31, 0, input);
throw nvae;
}
switch (alt31) {
case 1 :
// InternalLimp.g:3882:2: kw= '<'
{
kw=(Token)match(input,65,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getRelationalOpAccess().getLessThanSignKeyword_0());
}
}
break;
case 2 :
// InternalLimp.g:3889:2: kw= '<='
{
kw=(Token)match(input,66,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getRelationalOpAccess().getLessThanSignEqualsSignKeyword_1());
}
}
break;
case 3 :
// InternalLimp.g:3896:2: kw= '>'
{
kw=(Token)match(input,67,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getRelationalOpAccess().getGreaterThanSignKeyword_2());
}
}
break;
case 4 :
// InternalLimp.g:3903:2: kw= '>='
{
kw=(Token)match(input,68,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getRelationalOpAccess().getGreaterThanSignEqualsSignKeyword_3());
}
}
break;
case 5 :
// InternalLimp.g:3910:2: kw= '=='
{
kw=(Token)match(input,69,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getRelationalOpAccess().getEqualsSignEqualsSignKeyword_4());
}
}
break;
case 6 :
// InternalLimp.g:3917:2: kw= '<>'
{
kw=(Token)match(input,70,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getRelationalOpAccess().getLessThanSignGreaterThanSignKeyword_5());
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRelationalOp"
// $ANTLR start "entryRuleRelationalExpr"
// InternalLimp.g:3930:1: entryRuleRelationalExpr returns [EObject current=null] : iv_ruleRelationalExpr= ruleRelationalExpr EOF ;
public final EObject entryRuleRelationalExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleRelationalExpr = null;
try {
// InternalLimp.g:3931:2: (iv_ruleRelationalExpr= ruleRelationalExpr EOF )
// InternalLimp.g:3932:2: iv_ruleRelationalExpr= ruleRelationalExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRelationalExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleRelationalExpr=ruleRelationalExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleRelationalExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRelationalExpr"
// $ANTLR start "ruleRelationalExpr"
// InternalLimp.g:3939:1: ruleRelationalExpr returns [EObject current=null] : (this_PlusExpr_0= rulePlusExpr ( ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) ) ( (lv_right_3_0= rulePlusExpr ) ) )? ) ;
public final EObject ruleRelationalExpr() throws RecognitionException {
EObject current = null;
EObject this_PlusExpr_0 = null;
AntlrDatatypeRuleToken lv_op_2_0 = null;
EObject lv_right_3_0 = null;
enterRule();
try {
// InternalLimp.g:3942:28: ( (this_PlusExpr_0= rulePlusExpr ( ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) ) ( (lv_right_3_0= rulePlusExpr ) ) )? ) )
// InternalLimp.g:3943:1: (this_PlusExpr_0= rulePlusExpr ( ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) ) ( (lv_right_3_0= rulePlusExpr ) ) )? )
{
// InternalLimp.g:3943:1: (this_PlusExpr_0= rulePlusExpr ( ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) ) ( (lv_right_3_0= rulePlusExpr ) ) )? )
// InternalLimp.g:3944:5: this_PlusExpr_0= rulePlusExpr ( ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) ) ( (lv_right_3_0= rulePlusExpr ) ) )?
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRelationalExprAccess().getPlusExprParserRuleCall_0());
}
pushFollow(FOLLOW_48);
this_PlusExpr_0=rulePlusExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_PlusExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:3952:1: ( ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) ) ( (lv_right_3_0= rulePlusExpr ) ) )?
int alt32=2;
int LA32_0 = input.LA(1);
if ( (LA32_0==65) && (synpred5_InternalLimp())) {
alt32=1;
}
else if ( (LA32_0==66) && (synpred5_InternalLimp())) {
alt32=1;
}
else if ( (LA32_0==67) && (synpred5_InternalLimp())) {
alt32=1;
}
else if ( (LA32_0==68) && (synpred5_InternalLimp())) {
alt32=1;
}
else if ( (LA32_0==69) && (synpred5_InternalLimp())) {
alt32=1;
}
else if ( (LA32_0==70) && (synpred5_InternalLimp())) {
alt32=1;
}
switch (alt32) {
case 1 :
// InternalLimp.g:3952:2: ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) ) ( (lv_right_3_0= rulePlusExpr ) )
{
// InternalLimp.g:3952:2: ( ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) ) )
// InternalLimp.g:3952:3: ( ( () ( ( ruleRelationalOp ) ) ) )=> ( () ( (lv_op_2_0= ruleRelationalOp ) ) )
{
// InternalLimp.g:3957:6: ( () ( (lv_op_2_0= ruleRelationalOp ) ) )
// InternalLimp.g:3957:7: () ( (lv_op_2_0= ruleRelationalOp ) )
{
// InternalLimp.g:3957:7: ()
// InternalLimp.g:3958:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getRelationalExprAccess().getBinaryExprLeftAction_1_0_0_0(),
current);
}
}
// InternalLimp.g:3963:2: ( (lv_op_2_0= ruleRelationalOp ) )
// InternalLimp.g:3964:1: (lv_op_2_0= ruleRelationalOp )
{
// InternalLimp.g:3964:1: (lv_op_2_0= ruleRelationalOp )
// InternalLimp.g:3965:3: lv_op_2_0= ruleRelationalOp
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRelationalExprAccess().getOpRelationalOpParserRuleCall_1_0_0_1_0());
}
pushFollow(FOLLOW_32);
lv_op_2_0=ruleRelationalOp();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRelationalExprRule());
}
set(
current,
"op",
lv_op_2_0,
"com.rockwellcollins.atc.Limp.RelationalOp");
afterParserOrEnumRuleCall();
}
}
}
}
}
// InternalLimp.g:3981:4: ( (lv_right_3_0= rulePlusExpr ) )
// InternalLimp.g:3982:1: (lv_right_3_0= rulePlusExpr )
{
// InternalLimp.g:3982:1: (lv_right_3_0= rulePlusExpr )
// InternalLimp.g:3983:3: lv_right_3_0= rulePlusExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRelationalExprAccess().getRightPlusExprParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_2);
lv_right_3_0=rulePlusExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRelationalExprRule());
}
set(
current,
"right",
lv_right_3_0,
"com.rockwellcollins.atc.Limp.PlusExpr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRelationalExpr"
// $ANTLR start "entryRulePlusExpr"
// InternalLimp.g:4007:1: entryRulePlusExpr returns [EObject current=null] : iv_rulePlusExpr= rulePlusExpr EOF ;
public final EObject entryRulePlusExpr() throws RecognitionException {
EObject current = null;
EObject iv_rulePlusExpr = null;
try {
// InternalLimp.g:4008:2: (iv_rulePlusExpr= rulePlusExpr EOF )
// InternalLimp.g:4009:2: iv_rulePlusExpr= rulePlusExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getPlusExprRule());
}
pushFollow(FOLLOW_1);
iv_rulePlusExpr=rulePlusExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_rulePlusExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRulePlusExpr"
// $ANTLR start "rulePlusExpr"
// InternalLimp.g:4016:1: rulePlusExpr returns [EObject current=null] : (this_MultExpr_0= ruleMultExpr ( ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) ) ( (lv_right_3_0= ruleMultExpr ) ) )* ) ;
public final EObject rulePlusExpr() throws RecognitionException {
EObject current = null;
Token lv_op_2_1=null;
Token lv_op_2_2=null;
EObject this_MultExpr_0 = null;
EObject lv_right_3_0 = null;
enterRule();
try {
// InternalLimp.g:4019:28: ( (this_MultExpr_0= ruleMultExpr ( ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) ) ( (lv_right_3_0= ruleMultExpr ) ) )* ) )
// InternalLimp.g:4020:1: (this_MultExpr_0= ruleMultExpr ( ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) ) ( (lv_right_3_0= ruleMultExpr ) ) )* )
{
// InternalLimp.g:4020:1: (this_MultExpr_0= ruleMultExpr ( ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) ) ( (lv_right_3_0= ruleMultExpr ) ) )* )
// InternalLimp.g:4021:5: this_MultExpr_0= ruleMultExpr ( ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) ) ( (lv_right_3_0= ruleMultExpr ) ) )*
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getPlusExprAccess().getMultExprParserRuleCall_0());
}
pushFollow(FOLLOW_49);
this_MultExpr_0=ruleMultExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_MultExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:4029:1: ( ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) ) ( (lv_right_3_0= ruleMultExpr ) ) )*
loop34:
do {
int alt34=2;
int LA34_0 = input.LA(1);
if ( (LA34_0==71) && (synpred6_InternalLimp())) {
alt34=1;
}
else if ( (LA34_0==72) && (synpred6_InternalLimp())) {
alt34=1;
}
switch (alt34) {
case 1 :
// InternalLimp.g:4029:2: ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) ) ( (lv_right_3_0= ruleMultExpr ) )
{
// InternalLimp.g:4029:2: ( ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) ) )
// InternalLimp.g:4029:3: ( ( () ( ( ( '+' | '-' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) )
{
// InternalLimp.g:4042:6: ( () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) ) )
// InternalLimp.g:4042:7: () ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) )
{
// InternalLimp.g:4042:7: ()
// InternalLimp.g:4043:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getPlusExprAccess().getBinaryExprLeftAction_1_0_0_0(),
current);
}
}
// InternalLimp.g:4048:2: ( ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) ) )
// InternalLimp.g:4049:1: ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) )
{
// InternalLimp.g:4049:1: ( (lv_op_2_1= '+' | lv_op_2_2= '-' ) )
// InternalLimp.g:4050:1: (lv_op_2_1= '+' | lv_op_2_2= '-' )
{
// InternalLimp.g:4050:1: (lv_op_2_1= '+' | lv_op_2_2= '-' )
int alt33=2;
int LA33_0 = input.LA(1);
if ( (LA33_0==71) ) {
alt33=1;
}
else if ( (LA33_0==72) ) {
alt33=2;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 33, 0, input);
throw nvae;
}
switch (alt33) {
case 1 :
// InternalLimp.g:4051:3: lv_op_2_1= '+'
{
lv_op_2_1=(Token)match(input,71,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_op_2_1, grammarAccess.getPlusExprAccess().getOpPlusSignKeyword_1_0_0_1_0_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getPlusExprRule());
}
setWithLastConsumed(current, "op", lv_op_2_1, null);
}
}
break;
case 2 :
// InternalLimp.g:4063:8: lv_op_2_2= '-'
{
lv_op_2_2=(Token)match(input,72,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_op_2_2, grammarAccess.getPlusExprAccess().getOpHyphenMinusKeyword_1_0_0_1_0_1());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getPlusExprRule());
}
setWithLastConsumed(current, "op", lv_op_2_2, null);
}
}
break;
}
}
}
}
}
// InternalLimp.g:4078:4: ( (lv_right_3_0= ruleMultExpr ) )
// InternalLimp.g:4079:1: (lv_right_3_0= ruleMultExpr )
{
// InternalLimp.g:4079:1: (lv_right_3_0= ruleMultExpr )
// InternalLimp.g:4080:3: lv_right_3_0= ruleMultExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getPlusExprAccess().getRightMultExprParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_49);
lv_right_3_0=ruleMultExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getPlusExprRule());
}
set(
current,
"right",
lv_right_3_0,
"com.rockwellcollins.atc.Limp.MultExpr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop34;
}
} while (true);
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "rulePlusExpr"
// $ANTLR start "entryRuleMultExpr"
// InternalLimp.g:4104:1: entryRuleMultExpr returns [EObject current=null] : iv_ruleMultExpr= ruleMultExpr EOF ;
public final EObject entryRuleMultExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleMultExpr = null;
try {
// InternalLimp.g:4105:2: (iv_ruleMultExpr= ruleMultExpr EOF )
// InternalLimp.g:4106:2: iv_ruleMultExpr= ruleMultExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getMultExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleMultExpr=ruleMultExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleMultExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleMultExpr"
// $ANTLR start "ruleMultExpr"
// InternalLimp.g:4113:1: ruleMultExpr returns [EObject current=null] : (this_UnaryExpr_0= ruleUnaryExpr ( ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) ) ( (lv_right_3_0= ruleUnaryExpr ) ) )* ) ;
public final EObject ruleMultExpr() throws RecognitionException {
EObject current = null;
Token lv_op_2_1=null;
Token lv_op_2_2=null;
EObject this_UnaryExpr_0 = null;
EObject lv_right_3_0 = null;
enterRule();
try {
// InternalLimp.g:4116:28: ( (this_UnaryExpr_0= ruleUnaryExpr ( ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) ) ( (lv_right_3_0= ruleUnaryExpr ) ) )* ) )
// InternalLimp.g:4117:1: (this_UnaryExpr_0= ruleUnaryExpr ( ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) ) ( (lv_right_3_0= ruleUnaryExpr ) ) )* )
{
// InternalLimp.g:4117:1: (this_UnaryExpr_0= ruleUnaryExpr ( ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) ) ( (lv_right_3_0= ruleUnaryExpr ) ) )* )
// InternalLimp.g:4118:5: this_UnaryExpr_0= ruleUnaryExpr ( ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) ) ( (lv_right_3_0= ruleUnaryExpr ) ) )*
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getMultExprAccess().getUnaryExprParserRuleCall_0());
}
pushFollow(FOLLOW_50);
this_UnaryExpr_0=ruleUnaryExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_UnaryExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:4126:1: ( ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) ) ( (lv_right_3_0= ruleUnaryExpr ) ) )*
loop36:
do {
int alt36=2;
int LA36_0 = input.LA(1);
if ( (LA36_0==73) && (synpred7_InternalLimp())) {
alt36=1;
}
else if ( (LA36_0==74) && (synpred7_InternalLimp())) {
alt36=1;
}
switch (alt36) {
case 1 :
// InternalLimp.g:4126:2: ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) ) ( (lv_right_3_0= ruleUnaryExpr ) )
{
// InternalLimp.g:4126:2: ( ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) ) )
// InternalLimp.g:4126:3: ( ( () ( ( ( '*' | '/' ) ) ) ) )=> ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) )
{
// InternalLimp.g:4139:6: ( () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) ) )
// InternalLimp.g:4139:7: () ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) )
{
// InternalLimp.g:4139:7: ()
// InternalLimp.g:4140:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getMultExprAccess().getBinaryExprLeftAction_1_0_0_0(),
current);
}
}
// InternalLimp.g:4145:2: ( ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) ) )
// InternalLimp.g:4146:1: ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) )
{
// InternalLimp.g:4146:1: ( (lv_op_2_1= '*' | lv_op_2_2= '/' ) )
// InternalLimp.g:4147:1: (lv_op_2_1= '*' | lv_op_2_2= '/' )
{
// InternalLimp.g:4147:1: (lv_op_2_1= '*' | lv_op_2_2= '/' )
int alt35=2;
int LA35_0 = input.LA(1);
if ( (LA35_0==73) ) {
alt35=1;
}
else if ( (LA35_0==74) ) {
alt35=2;
}
else {
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 35, 0, input);
throw nvae;
}
switch (alt35) {
case 1 :
// InternalLimp.g:4148:3: lv_op_2_1= '*'
{
lv_op_2_1=(Token)match(input,73,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_op_2_1, grammarAccess.getMultExprAccess().getOpAsteriskKeyword_1_0_0_1_0_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getMultExprRule());
}
setWithLastConsumed(current, "op", lv_op_2_1, null);
}
}
break;
case 2 :
// InternalLimp.g:4160:8: lv_op_2_2= '/'
{
lv_op_2_2=(Token)match(input,74,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_op_2_2, grammarAccess.getMultExprAccess().getOpSolidusKeyword_1_0_0_1_0_1());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getMultExprRule());
}
setWithLastConsumed(current, "op", lv_op_2_2, null);
}
}
break;
}
}
}
}
}
// InternalLimp.g:4175:4: ( (lv_right_3_0= ruleUnaryExpr ) )
// InternalLimp.g:4176:1: (lv_right_3_0= ruleUnaryExpr )
{
// InternalLimp.g:4176:1: (lv_right_3_0= ruleUnaryExpr )
// InternalLimp.g:4177:3: lv_right_3_0= ruleUnaryExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getMultExprAccess().getRightUnaryExprParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_50);
lv_right_3_0=ruleUnaryExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getMultExprRule());
}
set(
current,
"right",
lv_right_3_0,
"com.rockwellcollins.atc.Limp.UnaryExpr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop36;
}
} while (true);
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleMultExpr"
// $ANTLR start "entryRuleUnaryExpr"
// InternalLimp.g:4201:1: entryRuleUnaryExpr returns [EObject current=null] : iv_ruleUnaryExpr= ruleUnaryExpr EOF ;
public final EObject entryRuleUnaryExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleUnaryExpr = null;
try {
// InternalLimp.g:4202:2: (iv_ruleUnaryExpr= ruleUnaryExpr EOF )
// InternalLimp.g:4203:2: iv_ruleUnaryExpr= ruleUnaryExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getUnaryExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleUnaryExpr=ruleUnaryExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleUnaryExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleUnaryExpr"
// $ANTLR start "ruleUnaryExpr"
// InternalLimp.g:4210:1: ruleUnaryExpr returns [EObject current=null] : (this_AccessExpr_0= ruleAccessExpr | ( () otherlv_2= 'not' ( (lv_expr_3_0= ruleUnaryExpr ) ) ) | ( () otherlv_5= '-' ( (lv_expr_6_0= ruleUnaryExpr ) ) ) ) ;
public final EObject ruleUnaryExpr() throws RecognitionException {
EObject current = null;
Token otherlv_2=null;
Token otherlv_5=null;
EObject this_AccessExpr_0 = null;
EObject lv_expr_3_0 = null;
EObject lv_expr_6_0 = null;
enterRule();
try {
// InternalLimp.g:4213:28: ( (this_AccessExpr_0= ruleAccessExpr | ( () otherlv_2= 'not' ( (lv_expr_3_0= ruleUnaryExpr ) ) ) | ( () otherlv_5= '-' ( (lv_expr_6_0= ruleUnaryExpr ) ) ) ) )
// InternalLimp.g:4214:1: (this_AccessExpr_0= ruleAccessExpr | ( () otherlv_2= 'not' ( (lv_expr_3_0= ruleUnaryExpr ) ) ) | ( () otherlv_5= '-' ( (lv_expr_6_0= ruleUnaryExpr ) ) ) )
{
// InternalLimp.g:4214:1: (this_AccessExpr_0= ruleAccessExpr | ( () otherlv_2= 'not' ( (lv_expr_3_0= ruleUnaryExpr ) ) ) | ( () otherlv_5= '-' ( (lv_expr_6_0= ruleUnaryExpr ) ) ) )
int alt37=3;
switch ( input.LA(1) ) {
case RULE_STRING:
case RULE_ID:
case RULE_INT:
case RULE_BOOLEAN:
case RULE_REAL:
case 17:
case 30:
case 31:
case 73:
case 78:
case 79:
{
alt37=1;
}
break;
case 75:
{
alt37=2;
}
break;
case 72:
{
alt37=3;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return current;}
NoViableAltException nvae =
new NoViableAltException("", 37, 0, input);
throw nvae;
}
switch (alt37) {
case 1 :
// InternalLimp.g:4215:5: this_AccessExpr_0= ruleAccessExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getUnaryExprAccess().getAccessExprParserRuleCall_0());
}
pushFollow(FOLLOW_2);
this_AccessExpr_0=ruleAccessExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_AccessExpr_0;
afterParserOrEnumRuleCall();
}
}
break;
case 2 :
// InternalLimp.g:4224:6: ( () otherlv_2= 'not' ( (lv_expr_3_0= ruleUnaryExpr ) ) )
{
// InternalLimp.g:4224:6: ( () otherlv_2= 'not' ( (lv_expr_3_0= ruleUnaryExpr ) ) )
// InternalLimp.g:4224:7: () otherlv_2= 'not' ( (lv_expr_3_0= ruleUnaryExpr ) )
{
// InternalLimp.g:4224:7: ()
// InternalLimp.g:4225:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getUnaryExprAccess().getUnaryNegationExprAction_1_0(),
current);
}
}
otherlv_2=(Token)match(input,75,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getUnaryExprAccess().getNotKeyword_1_1());
}
// InternalLimp.g:4234:1: ( (lv_expr_3_0= ruleUnaryExpr ) )
// InternalLimp.g:4235:1: (lv_expr_3_0= ruleUnaryExpr )
{
// InternalLimp.g:4235:1: (lv_expr_3_0= ruleUnaryExpr )
// InternalLimp.g:4236:3: lv_expr_3_0= ruleUnaryExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getUnaryExprAccess().getExprUnaryExprParserRuleCall_1_2_0());
}
pushFollow(FOLLOW_2);
lv_expr_3_0=ruleUnaryExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getUnaryExprRule());
}
set(
current,
"expr",
lv_expr_3_0,
"com.rockwellcollins.atc.Limp.UnaryExpr");
afterParserOrEnumRuleCall();
}
}
}
}
}
break;
case 3 :
// InternalLimp.g:4253:6: ( () otherlv_5= '-' ( (lv_expr_6_0= ruleUnaryExpr ) ) )
{
// InternalLimp.g:4253:6: ( () otherlv_5= '-' ( (lv_expr_6_0= ruleUnaryExpr ) ) )
// InternalLimp.g:4253:7: () otherlv_5= '-' ( (lv_expr_6_0= ruleUnaryExpr ) )
{
// InternalLimp.g:4253:7: ()
// InternalLimp.g:4254:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getUnaryExprAccess().getUnaryMinusExprAction_2_0(),
current);
}
}
otherlv_5=(Token)match(input,72,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getUnaryExprAccess().getHyphenMinusKeyword_2_1());
}
// InternalLimp.g:4263:1: ( (lv_expr_6_0= ruleUnaryExpr ) )
// InternalLimp.g:4264:1: (lv_expr_6_0= ruleUnaryExpr )
{
// InternalLimp.g:4264:1: (lv_expr_6_0= ruleUnaryExpr )
// InternalLimp.g:4265:3: lv_expr_6_0= ruleUnaryExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getUnaryExprAccess().getExprUnaryExprParserRuleCall_2_2_0());
}
pushFollow(FOLLOW_2);
lv_expr_6_0=ruleUnaryExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getUnaryExprRule());
}
set(
current,
"expr",
lv_expr_6_0,
"com.rockwellcollins.atc.Limp.UnaryExpr");
afterParserOrEnumRuleCall();
}
}
}
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleUnaryExpr"
// $ANTLR start "entryRuleAccessExpr"
// InternalLimp.g:4289:1: entryRuleAccessExpr returns [EObject current=null] : iv_ruleAccessExpr= ruleAccessExpr EOF ;
public final EObject entryRuleAccessExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleAccessExpr = null;
try {
// InternalLimp.g:4290:2: (iv_ruleAccessExpr= ruleAccessExpr EOF )
// InternalLimp.g:4291:2: iv_ruleAccessExpr= ruleAccessExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAccessExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleAccessExpr=ruleAccessExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleAccessExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleAccessExpr"
// $ANTLR start "ruleAccessExpr"
// InternalLimp.g:4298:1: ruleAccessExpr returns [EObject current=null] : (this_TerminalExpr_0= ruleTerminalExpr ( ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) ) | ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' ) | ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' ) )* ) ;
public final EObject ruleAccessExpr() throws RecognitionException {
EObject current = null;
Token otherlv_2=null;
Token lv_field_3_0=null;
Token otherlv_5=null;
Token lv_field_6_0=null;
Token otherlv_7=null;
Token otherlv_9=null;
Token otherlv_11=null;
Token otherlv_14=null;
Token otherlv_16=null;
EObject this_TerminalExpr_0 = null;
EObject lv_value_8_0 = null;
EObject lv_index_12_0 = null;
EObject lv_value_15_0 = null;
enterRule();
try {
// InternalLimp.g:4301:28: ( (this_TerminalExpr_0= ruleTerminalExpr ( ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) ) | ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' ) | ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' ) )* ) )
// InternalLimp.g:4302:1: (this_TerminalExpr_0= ruleTerminalExpr ( ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) ) | ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' ) | ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' ) )* )
{
// InternalLimp.g:4302:1: (this_TerminalExpr_0= ruleTerminalExpr ( ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) ) | ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' ) | ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' ) )* )
// InternalLimp.g:4303:5: this_TerminalExpr_0= ruleTerminalExpr ( ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) ) | ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' ) | ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' ) )*
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAccessExprAccess().getTerminalExprParserRuleCall_0());
}
pushFollow(FOLLOW_51);
this_TerminalExpr_0=ruleTerminalExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_TerminalExpr_0;
afterParserOrEnumRuleCall();
}
// InternalLimp.g:4311:1: ( ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) ) | ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' ) | ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' ) )*
loop39:
do {
int alt39=4;
int LA39_0 = input.LA(1);
if ( (LA39_0==26) ) {
int LA39_2 = input.LA(2);
if ( (LA39_2==RULE_ID) ) {
int LA39_5 = input.LA(3);
if ( (LA39_5==77) && (synpred9_InternalLimp())) {
alt39=2;
}
}
}
else if ( (LA39_0==76) && (synpred8_InternalLimp())) {
alt39=1;
}
else if ( (LA39_0==32) && (synpred10_InternalLimp())) {
alt39=3;
}
switch (alt39) {
case 1 :
// InternalLimp.g:4311:2: ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) )
{
// InternalLimp.g:4311:2: ( ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) ) )
// InternalLimp.g:4311:3: ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) ) ( (lv_field_3_0= RULE_ID ) )
{
// InternalLimp.g:4311:3: ( ( ( () '.' ) )=> ( () otherlv_2= '.' ) )
// InternalLimp.g:4311:4: ( ( () '.' ) )=> ( () otherlv_2= '.' )
{
// InternalLimp.g:4313:5: ( () otherlv_2= '.' )
// InternalLimp.g:4313:6: () otherlv_2= '.'
{
// InternalLimp.g:4313:6: ()
// InternalLimp.g:4314:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getAccessExprAccess().getRecordAccessExprRecordAction_1_0_0_0_0(),
current);
}
}
otherlv_2=(Token)match(input,76,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getAccessExprAccess().getFullStopKeyword_1_0_0_0_1());
}
}
}
// InternalLimp.g:4323:3: ( (lv_field_3_0= RULE_ID ) )
// InternalLimp.g:4324:1: (lv_field_3_0= RULE_ID )
{
// InternalLimp.g:4324:1: (lv_field_3_0= RULE_ID )
// InternalLimp.g:4325:3: lv_field_3_0= RULE_ID
{
lv_field_3_0=(Token)match(input,RULE_ID,FOLLOW_51); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_field_3_0, grammarAccess.getAccessExprAccess().getFieldIDTerminalRuleCall_1_0_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getAccessExprRule());
}
setWithLastConsumed(
current,
"field",
lv_field_3_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
}
}
break;
case 2 :
// InternalLimp.g:4342:6: ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' )
{
// InternalLimp.g:4342:6: ( ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}' )
// InternalLimp.g:4342:7: ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) ) ( (lv_value_8_0= ruleExpr ) ) otherlv_9= '}'
{
// InternalLimp.g:4342:7: ( ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' ) )
// InternalLimp.g:4342:8: ( ( () '{' ( ( RULE_ID ) ) ':=' ) )=> ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' )
{
// InternalLimp.g:4350:5: ( () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':=' )
// InternalLimp.g:4350:6: () otherlv_5= '{' ( (lv_field_6_0= RULE_ID ) ) otherlv_7= ':='
{
// InternalLimp.g:4350:6: ()
// InternalLimp.g:4351:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getAccessExprAccess().getRecordUpdateExprRecordAction_1_1_0_0_0(),
current);
}
}
otherlv_5=(Token)match(input,26,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getAccessExprAccess().getLeftCurlyBracketKeyword_1_1_0_0_1());
}
// InternalLimp.g:4360:1: ( (lv_field_6_0= RULE_ID ) )
// InternalLimp.g:4361:1: (lv_field_6_0= RULE_ID )
{
// InternalLimp.g:4361:1: (lv_field_6_0= RULE_ID )
// InternalLimp.g:4362:3: lv_field_6_0= RULE_ID
{
lv_field_6_0=(Token)match(input,RULE_ID,FOLLOW_52); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_field_6_0, grammarAccess.getAccessExprAccess().getFieldIDTerminalRuleCall_1_1_0_0_2_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getAccessExprRule());
}
setWithLastConsumed(
current,
"field",
lv_field_6_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_7=(Token)match(input,77,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_7, grammarAccess.getAccessExprAccess().getColonEqualsSignKeyword_1_1_0_0_3());
}
}
}
// InternalLimp.g:4382:3: ( (lv_value_8_0= ruleExpr ) )
// InternalLimp.g:4383:1: (lv_value_8_0= ruleExpr )
{
// InternalLimp.g:4383:1: (lv_value_8_0= ruleExpr )
// InternalLimp.g:4384:3: lv_value_8_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAccessExprAccess().getValueExprParserRuleCall_1_1_1_0());
}
pushFollow(FOLLOW_53);
lv_value_8_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getAccessExprRule());
}
set(
current,
"value",
lv_value_8_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
otherlv_9=(Token)match(input,27,FOLLOW_51); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_9, grammarAccess.getAccessExprAccess().getRightCurlyBracketKeyword_1_1_2());
}
}
}
break;
case 3 :
// InternalLimp.g:4405:6: ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' )
{
// InternalLimp.g:4405:6: ( ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']' )
// InternalLimp.g:4405:7: ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) ) ( (lv_index_12_0= ruleExpr ) ) ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )? otherlv_16= ']'
{
// InternalLimp.g:4405:7: ( ( ( () '[' ) )=> ( () otherlv_11= '[' ) )
// InternalLimp.g:4405:8: ( ( () '[' ) )=> ( () otherlv_11= '[' )
{
// InternalLimp.g:4407:5: ( () otherlv_11= '[' )
// InternalLimp.g:4407:6: () otherlv_11= '['
{
// InternalLimp.g:4407:6: ()
// InternalLimp.g:4408:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getAccessExprAccess().getArrayAccessExprArrayAction_1_2_0_0_0(),
current);
}
}
otherlv_11=(Token)match(input,32,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_11, grammarAccess.getAccessExprAccess().getLeftSquareBracketKeyword_1_2_0_0_1());
}
}
}
// InternalLimp.g:4417:3: ( (lv_index_12_0= ruleExpr ) )
// InternalLimp.g:4418:1: (lv_index_12_0= ruleExpr )
{
// InternalLimp.g:4418:1: (lv_index_12_0= ruleExpr )
// InternalLimp.g:4419:3: lv_index_12_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAccessExprAccess().getIndexExprParserRuleCall_1_2_1_0());
}
pushFollow(FOLLOW_54);
lv_index_12_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getAccessExprRule());
}
set(
current,
"index",
lv_index_12_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:4435:2: ( ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) ) )?
int alt38=2;
int LA38_0 = input.LA(1);
if ( (LA38_0==77) && (synpred11_InternalLimp())) {
alt38=1;
}
switch (alt38) {
case 1 :
// InternalLimp.g:4435:3: ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) ) ( (lv_value_15_0= ruleExpr ) )
{
// InternalLimp.g:4435:3: ( ( ( () ':=' ) )=> ( () otherlv_14= ':=' ) )
// InternalLimp.g:4435:4: ( ( () ':=' ) )=> ( () otherlv_14= ':=' )
{
// InternalLimp.g:4437:5: ( () otherlv_14= ':=' )
// InternalLimp.g:4437:6: () otherlv_14= ':='
{
// InternalLimp.g:4437:6: ()
// InternalLimp.g:4438:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getAccessExprAccess().getArrayUpdateExprAccessAction_1_2_2_0_0_0(),
current);
}
}
otherlv_14=(Token)match(input,77,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_14, grammarAccess.getAccessExprAccess().getColonEqualsSignKeyword_1_2_2_0_0_1());
}
}
}
// InternalLimp.g:4447:3: ( (lv_value_15_0= ruleExpr ) )
// InternalLimp.g:4448:1: (lv_value_15_0= ruleExpr )
{
// InternalLimp.g:4448:1: (lv_value_15_0= ruleExpr )
// InternalLimp.g:4449:3: lv_value_15_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getAccessExprAccess().getValueExprParserRuleCall_1_2_2_1_0());
}
pushFollow(FOLLOW_28);
lv_value_15_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getAccessExprRule());
}
set(
current,
"value",
lv_value_15_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
otherlv_16=(Token)match(input,33,FOLLOW_51); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_16, grammarAccess.getAccessExprAccess().getRightSquareBracketKeyword_1_2_3());
}
}
}
break;
default :
break loop39;
}
} while (true);
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleAccessExpr"
// $ANTLR start "entryRuleTerminalExpr"
// InternalLimp.g:4479:1: entryRuleTerminalExpr returns [EObject current=null] : iv_ruleTerminalExpr= ruleTerminalExpr EOF ;
public final EObject entryRuleTerminalExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleTerminalExpr = null;
try {
// InternalLimp.g:4480:2: (iv_ruleTerminalExpr= ruleTerminalExpr EOF )
// InternalLimp.g:4481:2: iv_ruleTerminalExpr= ruleTerminalExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTerminalExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleTerminalExpr=ruleTerminalExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleTerminalExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleTerminalExpr"
// $ANTLR start "ruleTerminalExpr"
// InternalLimp.g:4488:1: ruleTerminalExpr returns [EObject current=null] : ( (otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')' ) | ( () ( (lv_boolVal_4_0= RULE_BOOLEAN ) ) ) | ( () ( (lv_intVal_6_0= RULE_INT ) ) ) | ( () otherlv_8= '*' ) | ( () ( (lv_realVal_10_0= RULE_REAL ) ) ) | ( () ( (lv_stringVal_12_0= RULE_STRING ) ) ) | ( () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) ) ) | this_ArrayExpr_19= ruleArrayExpr | this_RecordExpr_20= ruleRecordExpr | ( () ( (otherlv_22= RULE_ID ) ) ) | ( () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')' ) ) ;
public final EObject ruleTerminalExpr() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_2=null;
Token lv_boolVal_4_0=null;
Token lv_intVal_6_0=null;
Token otherlv_8=null;
Token lv_realVal_10_0=null;
Token lv_stringVal_12_0=null;
Token otherlv_14=null;
Token otherlv_15=null;
Token otherlv_17=null;
Token otherlv_18=null;
Token otherlv_22=null;
Token otherlv_24=null;
Token otherlv_25=null;
Token otherlv_27=null;
EObject this_Expr_1 = null;
EObject this_ArrayExpr_19 = null;
EObject this_RecordExpr_20 = null;
EObject lv_exprs_26_0 = null;
enterRule();
try {
// InternalLimp.g:4491:28: ( ( (otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')' ) | ( () ( (lv_boolVal_4_0= RULE_BOOLEAN ) ) ) | ( () ( (lv_intVal_6_0= RULE_INT ) ) ) | ( () otherlv_8= '*' ) | ( () ( (lv_realVal_10_0= RULE_REAL ) ) ) | ( () ( (lv_stringVal_12_0= RULE_STRING ) ) ) | ( () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) ) ) | this_ArrayExpr_19= ruleArrayExpr | this_RecordExpr_20= ruleRecordExpr | ( () ( (otherlv_22= RULE_ID ) ) ) | ( () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')' ) ) )
// InternalLimp.g:4492:1: ( (otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')' ) | ( () ( (lv_boolVal_4_0= RULE_BOOLEAN ) ) ) | ( () ( (lv_intVal_6_0= RULE_INT ) ) ) | ( () otherlv_8= '*' ) | ( () ( (lv_realVal_10_0= RULE_REAL ) ) ) | ( () ( (lv_stringVal_12_0= RULE_STRING ) ) ) | ( () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) ) ) | this_ArrayExpr_19= ruleArrayExpr | this_RecordExpr_20= ruleRecordExpr | ( () ( (otherlv_22= RULE_ID ) ) ) | ( () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')' ) )
{
// InternalLimp.g:4492:1: ( (otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')' ) | ( () ( (lv_boolVal_4_0= RULE_BOOLEAN ) ) ) | ( () ( (lv_intVal_6_0= RULE_INT ) ) ) | ( () otherlv_8= '*' ) | ( () ( (lv_realVal_10_0= RULE_REAL ) ) ) | ( () ( (lv_stringVal_12_0= RULE_STRING ) ) ) | ( () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) ) ) | this_ArrayExpr_19= ruleArrayExpr | this_RecordExpr_20= ruleRecordExpr | ( () ( (otherlv_22= RULE_ID ) ) ) | ( () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')' ) )
int alt40=12;
alt40 = dfa40.predict(input);
switch (alt40) {
case 1 :
// InternalLimp.g:4492:2: (otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')' )
{
// InternalLimp.g:4492:2: (otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')' )
// InternalLimp.g:4492:4: otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')'
{
otherlv_0=(Token)match(input,17,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getTerminalExprAccess().getLeftParenthesisKeyword_0_0());
}
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTerminalExprAccess().getExprParserRuleCall_0_1());
}
pushFollow(FOLLOW_9);
this_Expr_1=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_Expr_1;
afterParserOrEnumRuleCall();
}
otherlv_2=(Token)match(input,18,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getTerminalExprAccess().getRightParenthesisKeyword_0_2());
}
}
}
break;
case 2 :
// InternalLimp.g:4510:6: ( () ( (lv_boolVal_4_0= RULE_BOOLEAN ) ) )
{
// InternalLimp.g:4510:6: ( () ( (lv_boolVal_4_0= RULE_BOOLEAN ) ) )
// InternalLimp.g:4510:7: () ( (lv_boolVal_4_0= RULE_BOOLEAN ) )
{
// InternalLimp.g:4510:7: ()
// InternalLimp.g:4511:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getBooleanLiteralExprAction_1_0(),
current);
}
}
// InternalLimp.g:4516:2: ( (lv_boolVal_4_0= RULE_BOOLEAN ) )
// InternalLimp.g:4517:1: (lv_boolVal_4_0= RULE_BOOLEAN )
{
// InternalLimp.g:4517:1: (lv_boolVal_4_0= RULE_BOOLEAN )
// InternalLimp.g:4518:3: lv_boolVal_4_0= RULE_BOOLEAN
{
lv_boolVal_4_0=(Token)match(input,RULE_BOOLEAN,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_boolVal_4_0, grammarAccess.getTerminalExprAccess().getBoolValBOOLEANTerminalRuleCall_1_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
setWithLastConsumed(
current,
"boolVal",
lv_boolVal_4_0,
"com.rockwellcollins.atc.Limp.BOOLEAN");
}
}
}
}
}
break;
case 3 :
// InternalLimp.g:4535:6: ( () ( (lv_intVal_6_0= RULE_INT ) ) )
{
// InternalLimp.g:4535:6: ( () ( (lv_intVal_6_0= RULE_INT ) ) )
// InternalLimp.g:4535:7: () ( (lv_intVal_6_0= RULE_INT ) )
{
// InternalLimp.g:4535:7: ()
// InternalLimp.g:4536:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getIntegerLiteralExprAction_2_0(),
current);
}
}
// InternalLimp.g:4541:2: ( (lv_intVal_6_0= RULE_INT ) )
// InternalLimp.g:4542:1: (lv_intVal_6_0= RULE_INT )
{
// InternalLimp.g:4542:1: (lv_intVal_6_0= RULE_INT )
// InternalLimp.g:4543:3: lv_intVal_6_0= RULE_INT
{
lv_intVal_6_0=(Token)match(input,RULE_INT,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_intVal_6_0, grammarAccess.getTerminalExprAccess().getIntValINTTerminalRuleCall_2_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
setWithLastConsumed(
current,
"intVal",
lv_intVal_6_0,
"com.rockwellcollins.atc.Limp.INT");
}
}
}
}
}
break;
case 4 :
// InternalLimp.g:4560:6: ( () otherlv_8= '*' )
{
// InternalLimp.g:4560:6: ( () otherlv_8= '*' )
// InternalLimp.g:4560:7: () otherlv_8= '*'
{
// InternalLimp.g:4560:7: ()
// InternalLimp.g:4561:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getIntegerWildCardExprAction_3_0(),
current);
}
}
otherlv_8=(Token)match(input,73,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_8, grammarAccess.getTerminalExprAccess().getAsteriskKeyword_3_1());
}
}
}
break;
case 5 :
// InternalLimp.g:4571:6: ( () ( (lv_realVal_10_0= RULE_REAL ) ) )
{
// InternalLimp.g:4571:6: ( () ( (lv_realVal_10_0= RULE_REAL ) ) )
// InternalLimp.g:4571:7: () ( (lv_realVal_10_0= RULE_REAL ) )
{
// InternalLimp.g:4571:7: ()
// InternalLimp.g:4572:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getRealLiteralExprAction_4_0(),
current);
}
}
// InternalLimp.g:4577:2: ( (lv_realVal_10_0= RULE_REAL ) )
// InternalLimp.g:4578:1: (lv_realVal_10_0= RULE_REAL )
{
// InternalLimp.g:4578:1: (lv_realVal_10_0= RULE_REAL )
// InternalLimp.g:4579:3: lv_realVal_10_0= RULE_REAL
{
lv_realVal_10_0=(Token)match(input,RULE_REAL,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_realVal_10_0, grammarAccess.getTerminalExprAccess().getRealValREALTerminalRuleCall_4_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
setWithLastConsumed(
current,
"realVal",
lv_realVal_10_0,
"com.rockwellcollins.atc.Limp.REAL");
}
}
}
}
}
break;
case 6 :
// InternalLimp.g:4596:6: ( () ( (lv_stringVal_12_0= RULE_STRING ) ) )
{
// InternalLimp.g:4596:6: ( () ( (lv_stringVal_12_0= RULE_STRING ) ) )
// InternalLimp.g:4596:7: () ( (lv_stringVal_12_0= RULE_STRING ) )
{
// InternalLimp.g:4596:7: ()
// InternalLimp.g:4597:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getStringLiteralExprAction_5_0(),
current);
}
}
// InternalLimp.g:4602:2: ( (lv_stringVal_12_0= RULE_STRING ) )
// InternalLimp.g:4603:1: (lv_stringVal_12_0= RULE_STRING )
{
// InternalLimp.g:4603:1: (lv_stringVal_12_0= RULE_STRING )
// InternalLimp.g:4604:3: lv_stringVal_12_0= RULE_STRING
{
lv_stringVal_12_0=(Token)match(input,RULE_STRING,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_stringVal_12_0, grammarAccess.getTerminalExprAccess().getStringValSTRINGTerminalRuleCall_5_1_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
setWithLastConsumed(
current,
"stringVal",
lv_stringVal_12_0,
"com.rockwellcollins.atc.Limp.STRING");
}
}
}
}
}
break;
case 7 :
// InternalLimp.g:4621:6: ( () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) ) )
{
// InternalLimp.g:4621:6: ( () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) ) )
// InternalLimp.g:4621:7: () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) )
{
// InternalLimp.g:4621:7: ()
// InternalLimp.g:4622:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getInitExprAction_6_0(),
current);
}
}
otherlv_14=(Token)match(input,78,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_14, grammarAccess.getTerminalExprAccess().getInitKeyword_6_1());
}
// InternalLimp.g:4631:1: ( (otherlv_15= RULE_ID ) )
// InternalLimp.g:4632:1: (otherlv_15= RULE_ID )
{
// InternalLimp.g:4632:1: (otherlv_15= RULE_ID )
// InternalLimp.g:4633:3: otherlv_15= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
}
otherlv_15=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_15, grammarAccess.getTerminalExprAccess().getIdVariableRefCrossReference_6_2_0());
}
}
}
}
}
break;
case 8 :
// InternalLimp.g:4645:6: ( () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) ) )
{
// InternalLimp.g:4645:6: ( () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) ) )
// InternalLimp.g:4645:7: () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) )
{
// InternalLimp.g:4645:7: ()
// InternalLimp.g:4646:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getSecondInitAction_7_0(),
current);
}
}
otherlv_17=(Token)match(input,79,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_17, grammarAccess.getTerminalExprAccess().getSecond_initKeyword_7_1());
}
// InternalLimp.g:4655:1: ( (otherlv_18= RULE_ID ) )
// InternalLimp.g:4656:1: (otherlv_18= RULE_ID )
{
// InternalLimp.g:4656:1: (otherlv_18= RULE_ID )
// InternalLimp.g:4657:3: otherlv_18= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
}
otherlv_18=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_18, grammarAccess.getTerminalExprAccess().getIdVariableRefCrossReference_7_2_0());
}
}
}
}
}
break;
case 9 :
// InternalLimp.g:4670:5: this_ArrayExpr_19= ruleArrayExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTerminalExprAccess().getArrayExprParserRuleCall_8());
}
pushFollow(FOLLOW_2);
this_ArrayExpr_19=ruleArrayExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_ArrayExpr_19;
afterParserOrEnumRuleCall();
}
}
break;
case 10 :
// InternalLimp.g:4680:5: this_RecordExpr_20= ruleRecordExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTerminalExprAccess().getRecordExprParserRuleCall_9());
}
pushFollow(FOLLOW_2);
this_RecordExpr_20=ruleRecordExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current = this_RecordExpr_20;
afterParserOrEnumRuleCall();
}
}
break;
case 11 :
// InternalLimp.g:4689:6: ( () ( (otherlv_22= RULE_ID ) ) )
{
// InternalLimp.g:4689:6: ( () ( (otherlv_22= RULE_ID ) ) )
// InternalLimp.g:4689:7: () ( (otherlv_22= RULE_ID ) )
{
// InternalLimp.g:4689:7: ()
// InternalLimp.g:4690:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getIdExprAction_10_0(),
current);
}
}
// InternalLimp.g:4695:2: ( (otherlv_22= RULE_ID ) )
// InternalLimp.g:4696:1: (otherlv_22= RULE_ID )
{
// InternalLimp.g:4696:1: (otherlv_22= RULE_ID )
// InternalLimp.g:4697:3: otherlv_22= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
}
otherlv_22=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_22, grammarAccess.getTerminalExprAccess().getIdVariableRefCrossReference_10_1_0());
}
}
}
}
}
break;
case 12 :
// InternalLimp.g:4709:6: ( () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')' )
{
// InternalLimp.g:4709:6: ( () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')' )
// InternalLimp.g:4709:7: () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')'
{
// InternalLimp.g:4709:7: ()
// InternalLimp.g:4710:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getTerminalExprAccess().getFcnCallExprAction_11_0(),
current);
}
}
// InternalLimp.g:4715:2: ( (otherlv_24= RULE_ID ) )
// InternalLimp.g:4716:1: (otherlv_24= RULE_ID )
{
// InternalLimp.g:4716:1: (otherlv_24= RULE_ID )
// InternalLimp.g:4717:3: otherlv_24= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getTerminalExprRule());
}
}
otherlv_24=(Token)match(input,RULE_ID,FOLLOW_7); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_24, grammarAccess.getTerminalExprAccess().getIdFunctionRefCrossReference_11_1_0());
}
}
}
otherlv_25=(Token)match(input,17,FOLLOW_55); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_25, grammarAccess.getTerminalExprAccess().getLeftParenthesisKeyword_11_2());
}
// InternalLimp.g:4732:1: ( (lv_exprs_26_0= ruleExprList ) )
// InternalLimp.g:4733:1: (lv_exprs_26_0= ruleExprList )
{
// InternalLimp.g:4733:1: (lv_exprs_26_0= ruleExprList )
// InternalLimp.g:4734:3: lv_exprs_26_0= ruleExprList
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getTerminalExprAccess().getExprsExprListParserRuleCall_11_3_0());
}
pushFollow(FOLLOW_9);
lv_exprs_26_0=ruleExprList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getTerminalExprRule());
}
set(
current,
"exprs",
lv_exprs_26_0,
"com.rockwellcollins.atc.Limp.ExprList");
afterParserOrEnumRuleCall();
}
}
}
otherlv_27=(Token)match(input,18,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_27, grammarAccess.getTerminalExprAccess().getRightParenthesisKeyword_11_4());
}
}
}
break;
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleTerminalExpr"
// $ANTLR start "entryRuleArrayExpr"
// InternalLimp.g:4762:1: entryRuleArrayExpr returns [EObject current=null] : iv_ruleArrayExpr= ruleArrayExpr EOF ;
public final EObject entryRuleArrayExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleArrayExpr = null;
try {
// InternalLimp.g:4763:2: (iv_ruleArrayExpr= ruleArrayExpr EOF )
// InternalLimp.g:4764:2: iv_ruleArrayExpr= ruleArrayExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getArrayExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleArrayExpr=ruleArrayExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleArrayExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleArrayExpr"
// $ANTLR start "ruleArrayExpr"
// InternalLimp.g:4771:1: ruleArrayExpr returns [EObject current=null] : (otherlv_0= 'array' ( (otherlv_1= RULE_ID ) ) otherlv_2= '[' ( (lv_exprList_3_0= ruleExpr ) ) (otherlv_4= ',' ( (lv_exprList_5_0= ruleExpr ) ) )* otherlv_6= ']' ) ;
public final EObject ruleArrayExpr() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token otherlv_2=null;
Token otherlv_4=null;
Token otherlv_6=null;
EObject lv_exprList_3_0 = null;
EObject lv_exprList_5_0 = null;
enterRule();
try {
// InternalLimp.g:4774:28: ( (otherlv_0= 'array' ( (otherlv_1= RULE_ID ) ) otherlv_2= '[' ( (lv_exprList_3_0= ruleExpr ) ) (otherlv_4= ',' ( (lv_exprList_5_0= ruleExpr ) ) )* otherlv_6= ']' ) )
// InternalLimp.g:4775:1: (otherlv_0= 'array' ( (otherlv_1= RULE_ID ) ) otherlv_2= '[' ( (lv_exprList_3_0= ruleExpr ) ) (otherlv_4= ',' ( (lv_exprList_5_0= ruleExpr ) ) )* otherlv_6= ']' )
{
// InternalLimp.g:4775:1: (otherlv_0= 'array' ( (otherlv_1= RULE_ID ) ) otherlv_2= '[' ( (lv_exprList_3_0= ruleExpr ) ) (otherlv_4= ',' ( (lv_exprList_5_0= ruleExpr ) ) )* otherlv_6= ']' )
// InternalLimp.g:4775:3: otherlv_0= 'array' ( (otherlv_1= RULE_ID ) ) otherlv_2= '[' ( (lv_exprList_3_0= ruleExpr ) ) (otherlv_4= ',' ( (lv_exprList_5_0= ruleExpr ) ) )* otherlv_6= ']'
{
otherlv_0=(Token)match(input,31,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getArrayExprAccess().getArrayKeyword_0());
}
// InternalLimp.g:4779:1: ( (otherlv_1= RULE_ID ) )
// InternalLimp.g:4780:1: (otherlv_1= RULE_ID )
{
// InternalLimp.g:4780:1: (otherlv_1= RULE_ID )
// InternalLimp.g:4781:3: otherlv_1= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getArrayExprRule());
}
}
otherlv_1=(Token)match(input,RULE_ID,FOLLOW_26); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getArrayExprAccess().getArrayDefinitionArrayTypeDefCrossReference_1_0());
}
}
}
otherlv_2=(Token)match(input,32,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getArrayExprAccess().getLeftSquareBracketKeyword_2());
}
// InternalLimp.g:4796:1: ( (lv_exprList_3_0= ruleExpr ) )
// InternalLimp.g:4797:1: (lv_exprList_3_0= ruleExpr )
{
// InternalLimp.g:4797:1: (lv_exprList_3_0= ruleExpr )
// InternalLimp.g:4798:3: lv_exprList_3_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getArrayExprAccess().getExprListExprParserRuleCall_3_0());
}
pushFollow(FOLLOW_56);
lv_exprList_3_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getArrayExprRule());
}
add(
current,
"exprList",
lv_exprList_3_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:4814:2: (otherlv_4= ',' ( (lv_exprList_5_0= ruleExpr ) ) )*
loop41:
do {
int alt41=2;
int LA41_0 = input.LA(1);
if ( (LA41_0==29) ) {
alt41=1;
}
switch (alt41) {
case 1 :
// InternalLimp.g:4814:4: otherlv_4= ',' ( (lv_exprList_5_0= ruleExpr ) )
{
otherlv_4=(Token)match(input,29,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getArrayExprAccess().getCommaKeyword_4_0());
}
// InternalLimp.g:4818:1: ( (lv_exprList_5_0= ruleExpr ) )
// InternalLimp.g:4819:1: (lv_exprList_5_0= ruleExpr )
{
// InternalLimp.g:4819:1: (lv_exprList_5_0= ruleExpr )
// InternalLimp.g:4820:3: lv_exprList_5_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getArrayExprAccess().getExprListExprParserRuleCall_4_1_0());
}
pushFollow(FOLLOW_56);
lv_exprList_5_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getArrayExprRule());
}
add(
current,
"exprList",
lv_exprList_5_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop41;
}
} while (true);
otherlv_6=(Token)match(input,33,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getArrayExprAccess().getRightSquareBracketKeyword_5());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleArrayExpr"
// $ANTLR start "entryRuleRecordExpr"
// InternalLimp.g:4848:1: entryRuleRecordExpr returns [EObject current=null] : iv_ruleRecordExpr= ruleRecordExpr EOF ;
public final EObject entryRuleRecordExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleRecordExpr = null;
try {
// InternalLimp.g:4849:2: (iv_ruleRecordExpr= ruleRecordExpr EOF )
// InternalLimp.g:4850:2: iv_ruleRecordExpr= ruleRecordExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleRecordExpr=ruleRecordExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleRecordExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRecordExpr"
// $ANTLR start "ruleRecordExpr"
// InternalLimp.g:4857:1: ruleRecordExpr returns [EObject current=null] : (otherlv_0= 'record' ( (otherlv_1= RULE_ID ) ) otherlv_2= '{' ( (lv_fieldExprList_3_0= ruleRecordFieldExpr ) ) (otherlv_4= ',' ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) ) )* otherlv_6= '}' ) ;
public final EObject ruleRecordExpr() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_1=null;
Token otherlv_2=null;
Token otherlv_4=null;
Token otherlv_6=null;
EObject lv_fieldExprList_3_0 = null;
EObject lv_fieldExprList_5_0 = null;
enterRule();
try {
// InternalLimp.g:4860:28: ( (otherlv_0= 'record' ( (otherlv_1= RULE_ID ) ) otherlv_2= '{' ( (lv_fieldExprList_3_0= ruleRecordFieldExpr ) ) (otherlv_4= ',' ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) ) )* otherlv_6= '}' ) )
// InternalLimp.g:4861:1: (otherlv_0= 'record' ( (otherlv_1= RULE_ID ) ) otherlv_2= '{' ( (lv_fieldExprList_3_0= ruleRecordFieldExpr ) ) (otherlv_4= ',' ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) ) )* otherlv_6= '}' )
{
// InternalLimp.g:4861:1: (otherlv_0= 'record' ( (otherlv_1= RULE_ID ) ) otherlv_2= '{' ( (lv_fieldExprList_3_0= ruleRecordFieldExpr ) ) (otherlv_4= ',' ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) ) )* otherlv_6= '}' )
// InternalLimp.g:4861:3: otherlv_0= 'record' ( (otherlv_1= RULE_ID ) ) otherlv_2= '{' ( (lv_fieldExprList_3_0= ruleRecordFieldExpr ) ) (otherlv_4= ',' ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) ) )* otherlv_6= '}'
{
otherlv_0=(Token)match(input,30,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_0, grammarAccess.getRecordExprAccess().getRecordKeyword_0());
}
// InternalLimp.g:4865:1: ( (otherlv_1= RULE_ID ) )
// InternalLimp.g:4866:1: (otherlv_1= RULE_ID )
{
// InternalLimp.g:4866:1: (otherlv_1= RULE_ID )
// InternalLimp.g:4867:3: otherlv_1= RULE_ID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getRecordExprRule());
}
}
otherlv_1=(Token)match(input,RULE_ID,FOLLOW_15); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getRecordExprAccess().getRecordDefinitionRecordTypeDefCrossReference_1_0());
}
}
}
otherlv_2=(Token)match(input,26,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getRecordExprAccess().getLeftCurlyBracketKeyword_2());
}
// InternalLimp.g:4882:1: ( (lv_fieldExprList_3_0= ruleRecordFieldExpr ) )
// InternalLimp.g:4883:1: (lv_fieldExprList_3_0= ruleRecordFieldExpr )
{
// InternalLimp.g:4883:1: (lv_fieldExprList_3_0= ruleRecordFieldExpr )
// InternalLimp.g:4884:3: lv_fieldExprList_3_0= ruleRecordFieldExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordExprAccess().getFieldExprListRecordFieldExprParserRuleCall_3_0());
}
pushFollow(FOLLOW_23);
lv_fieldExprList_3_0=ruleRecordFieldExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRecordExprRule());
}
add(
current,
"fieldExprList",
lv_fieldExprList_3_0,
"com.rockwellcollins.atc.Limp.RecordFieldExpr");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:4900:2: (otherlv_4= ',' ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) ) )*
loop42:
do {
int alt42=2;
int LA42_0 = input.LA(1);
if ( (LA42_0==29) ) {
alt42=1;
}
switch (alt42) {
case 1 :
// InternalLimp.g:4900:4: otherlv_4= ',' ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) )
{
otherlv_4=(Token)match(input,29,FOLLOW_6); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_4, grammarAccess.getRecordExprAccess().getCommaKeyword_4_0());
}
// InternalLimp.g:4904:1: ( (lv_fieldExprList_5_0= ruleRecordFieldExpr ) )
// InternalLimp.g:4905:1: (lv_fieldExprList_5_0= ruleRecordFieldExpr )
{
// InternalLimp.g:4905:1: (lv_fieldExprList_5_0= ruleRecordFieldExpr )
// InternalLimp.g:4906:3: lv_fieldExprList_5_0= ruleRecordFieldExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordExprAccess().getFieldExprListRecordFieldExprParserRuleCall_4_1_0());
}
pushFollow(FOLLOW_23);
lv_fieldExprList_5_0=ruleRecordFieldExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRecordExprRule());
}
add(
current,
"fieldExprList",
lv_fieldExprList_5_0,
"com.rockwellcollins.atc.Limp.RecordFieldExpr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop42;
}
} while (true);
otherlv_6=(Token)match(input,27,FOLLOW_2); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_6, grammarAccess.getRecordExprAccess().getRightCurlyBracketKeyword_5());
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRecordExpr"
// $ANTLR start "entryRuleRecordFieldExpr"
// InternalLimp.g:4934:1: entryRuleRecordFieldExpr returns [EObject current=null] : iv_ruleRecordFieldExpr= ruleRecordFieldExpr EOF ;
public final EObject entryRuleRecordFieldExpr() throws RecognitionException {
EObject current = null;
EObject iv_ruleRecordFieldExpr = null;
try {
// InternalLimp.g:4935:2: (iv_ruleRecordFieldExpr= ruleRecordFieldExpr EOF )
// InternalLimp.g:4936:2: iv_ruleRecordFieldExpr= ruleRecordFieldExpr EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordFieldExprRule());
}
pushFollow(FOLLOW_1);
iv_ruleRecordFieldExpr=ruleRecordFieldExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleRecordFieldExpr;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleRecordFieldExpr"
// $ANTLR start "ruleRecordFieldExpr"
// InternalLimp.g:4943:1: ruleRecordFieldExpr returns [EObject current=null] : ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= '=' ( (lv_fieldExpr_2_0= ruleExpr ) ) ) ;
public final EObject ruleRecordFieldExpr() throws RecognitionException {
EObject current = null;
Token lv_fieldName_0_0=null;
Token otherlv_1=null;
EObject lv_fieldExpr_2_0 = null;
enterRule();
try {
// InternalLimp.g:4946:28: ( ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= '=' ( (lv_fieldExpr_2_0= ruleExpr ) ) ) )
// InternalLimp.g:4947:1: ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= '=' ( (lv_fieldExpr_2_0= ruleExpr ) ) )
{
// InternalLimp.g:4947:1: ( ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= '=' ( (lv_fieldExpr_2_0= ruleExpr ) ) )
// InternalLimp.g:4947:2: ( (lv_fieldName_0_0= RULE_ID ) ) otherlv_1= '=' ( (lv_fieldExpr_2_0= ruleExpr ) )
{
// InternalLimp.g:4947:2: ( (lv_fieldName_0_0= RULE_ID ) )
// InternalLimp.g:4948:1: (lv_fieldName_0_0= RULE_ID )
{
// InternalLimp.g:4948:1: (lv_fieldName_0_0= RULE_ID )
// InternalLimp.g:4949:3: lv_fieldName_0_0= RULE_ID
{
lv_fieldName_0_0=(Token)match(input,RULE_ID,FOLLOW_19); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(lv_fieldName_0_0, grammarAccess.getRecordFieldExprAccess().getFieldNameIDTerminalRuleCall_0_0());
}
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getRecordFieldExprRule());
}
setWithLastConsumed(
current,
"fieldName",
lv_fieldName_0_0,
"com.rockwellcollins.atc.Limp.ID");
}
}
}
otherlv_1=(Token)match(input,24,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getRecordFieldExprAccess().getEqualsSignKeyword_1());
}
// InternalLimp.g:4969:1: ( (lv_fieldExpr_2_0= ruleExpr ) )
// InternalLimp.g:4970:1: (lv_fieldExpr_2_0= ruleExpr )
{
// InternalLimp.g:4970:1: (lv_fieldExpr_2_0= ruleExpr )
// InternalLimp.g:4971:3: lv_fieldExpr_2_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRecordFieldExprAccess().getFieldExprExprParserRuleCall_2_0());
}
pushFollow(FOLLOW_2);
lv_fieldExpr_2_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getRecordFieldExprRule());
}
set(
current,
"fieldExpr",
lv_fieldExpr_2_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleRecordFieldExpr"
// $ANTLR start "entryRuleExprList"
// InternalLimp.g:4995:1: entryRuleExprList returns [EObject current=null] : iv_ruleExprList= ruleExprList EOF ;
public final EObject entryRuleExprList() throws RecognitionException {
EObject current = null;
EObject iv_ruleExprList = null;
try {
// InternalLimp.g:4996:2: (iv_ruleExprList= ruleExprList EOF )
// InternalLimp.g:4997:2: iv_ruleExprList= ruleExprList EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExprListRule());
}
pushFollow(FOLLOW_1);
iv_ruleExprList=ruleExprList();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleExprList;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleExprList"
// $ANTLR start "ruleExprList"
// InternalLimp.g:5004:1: ruleExprList returns [EObject current=null] : ( () ( ( (lv_exprList_1_0= ruleExpr ) ) (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )* )? ) ;
public final EObject ruleExprList() throws RecognitionException {
EObject current = null;
Token otherlv_2=null;
EObject lv_exprList_1_0 = null;
EObject lv_exprList_3_0 = null;
enterRule();
try {
// InternalLimp.g:5007:28: ( ( () ( ( (lv_exprList_1_0= ruleExpr ) ) (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )* )? ) )
// InternalLimp.g:5008:1: ( () ( ( (lv_exprList_1_0= ruleExpr ) ) (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )* )? )
{
// InternalLimp.g:5008:1: ( () ( ( (lv_exprList_1_0= ruleExpr ) ) (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )* )? )
// InternalLimp.g:5008:2: () ( ( (lv_exprList_1_0= ruleExpr ) ) (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )* )?
{
// InternalLimp.g:5008:2: ()
// InternalLimp.g:5009:5:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElement(
grammarAccess.getExprListAccess().getExprListAction_0(),
current);
}
}
// InternalLimp.g:5014:2: ( ( (lv_exprList_1_0= ruleExpr ) ) (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )* )?
int alt44=2;
int LA44_0 = input.LA(1);
if ( ((LA44_0>=RULE_STRING && LA44_0<=RULE_REAL)||LA44_0==17||(LA44_0>=30 && LA44_0<=31)||LA44_0==61||(LA44_0>=72 && LA44_0<=73)||LA44_0==75||(LA44_0>=78 && LA44_0<=79)) ) {
alt44=1;
}
switch (alt44) {
case 1 :
// InternalLimp.g:5014:3: ( (lv_exprList_1_0= ruleExpr ) ) (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )*
{
// InternalLimp.g:5014:3: ( (lv_exprList_1_0= ruleExpr ) )
// InternalLimp.g:5015:1: (lv_exprList_1_0= ruleExpr )
{
// InternalLimp.g:5015:1: (lv_exprList_1_0= ruleExpr )
// InternalLimp.g:5016:3: lv_exprList_1_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExprListAccess().getExprListExprParserRuleCall_1_0_0());
}
pushFollow(FOLLOW_33);
lv_exprList_1_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getExprListRule());
}
add(
current,
"exprList",
lv_exprList_1_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
// InternalLimp.g:5032:2: (otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) ) )*
loop43:
do {
int alt43=2;
int LA43_0 = input.LA(1);
if ( (LA43_0==29) ) {
alt43=1;
}
switch (alt43) {
case 1 :
// InternalLimp.g:5032:4: otherlv_2= ',' ( (lv_exprList_3_0= ruleExpr ) )
{
otherlv_2=(Token)match(input,29,FOLLOW_32); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_2, grammarAccess.getExprListAccess().getCommaKeyword_1_1_0());
}
// InternalLimp.g:5036:1: ( (lv_exprList_3_0= ruleExpr ) )
// InternalLimp.g:5037:1: (lv_exprList_3_0= ruleExpr )
{
// InternalLimp.g:5037:1: (lv_exprList_3_0= ruleExpr )
// InternalLimp.g:5038:3: lv_exprList_3_0= ruleExpr
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getExprListAccess().getExprListExprParserRuleCall_1_1_1_0());
}
pushFollow(FOLLOW_33);
lv_exprList_3_0=ruleExpr();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getExprListRule());
}
add(
current,
"exprList",
lv_exprList_3_0,
"com.rockwellcollins.atc.Limp.Expr");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop43;
}
} while (true);
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleExprList"
// $ANTLR start synpred1_InternalLimp
public final void synpred1_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:3491:3: ( ( () '?' ) )
// InternalLimp.g:3491:4: ( () '?' )
{
// InternalLimp.g:3491:4: ( () '?' )
// InternalLimp.g:3491:5: () '?'
{
// InternalLimp.g:3491:5: ()
// InternalLimp.g:3492:1:
{
}
match(input,60,FOLLOW_2); if (state.failed) return ;
}
}
}
// $ANTLR end synpred1_InternalLimp
// $ANTLR start synpred2_InternalLimp
public final void synpred2_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:3662:3: ( ( () ( ( '=>' ) ) ) )
// InternalLimp.g:3662:4: ( () ( ( '=>' ) ) )
{
// InternalLimp.g:3662:4: ( () ( ( '=>' ) ) )
// InternalLimp.g:3662:5: () ( ( '=>' ) )
{
// InternalLimp.g:3662:5: ()
// InternalLimp.g:3663:1:
{
}
// InternalLimp.g:3663:2: ( ( '=>' ) )
// InternalLimp.g:3664:1: ( '=>' )
{
// InternalLimp.g:3664:1: ( '=>' )
// InternalLimp.g:3665:2: '=>'
{
match(input,62,FOLLOW_2); if (state.failed) return ;
}
}
}
}
}
// $ANTLR end synpred2_InternalLimp
// $ANTLR start synpred3_InternalLimp
public final void synpred3_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:3738:3: ( ( () ( ( 'or' ) ) ) )
// InternalLimp.g:3738:4: ( () ( ( 'or' ) ) )
{
// InternalLimp.g:3738:4: ( () ( ( 'or' ) ) )
// InternalLimp.g:3738:5: () ( ( 'or' ) )
{
// InternalLimp.g:3738:5: ()
// InternalLimp.g:3739:1:
{
}
// InternalLimp.g:3739:2: ( ( 'or' ) )
// InternalLimp.g:3740:1: ( 'or' )
{
// InternalLimp.g:3740:1: ( 'or' )
// InternalLimp.g:3741:2: 'or'
{
match(input,63,FOLLOW_2); if (state.failed) return ;
}
}
}
}
}
// $ANTLR end synpred3_InternalLimp
// $ANTLR start synpred4_InternalLimp
public final void synpred4_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:3814:3: ( ( () ( ( 'and' ) ) ) )
// InternalLimp.g:3814:4: ( () ( ( 'and' ) ) )
{
// InternalLimp.g:3814:4: ( () ( ( 'and' ) ) )
// InternalLimp.g:3814:5: () ( ( 'and' ) )
{
// InternalLimp.g:3814:5: ()
// InternalLimp.g:3815:1:
{
}
// InternalLimp.g:3815:2: ( ( 'and' ) )
// InternalLimp.g:3816:1: ( 'and' )
{
// InternalLimp.g:3816:1: ( 'and' )
// InternalLimp.g:3817:2: 'and'
{
match(input,64,FOLLOW_2); if (state.failed) return ;
}
}
}
}
}
// $ANTLR end synpred4_InternalLimp
// $ANTLR start synpred5_InternalLimp
public final void synpred5_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:3952:3: ( ( () ( ( ruleRelationalOp ) ) ) )
// InternalLimp.g:3952:4: ( () ( ( ruleRelationalOp ) ) )
{
// InternalLimp.g:3952:4: ( () ( ( ruleRelationalOp ) ) )
// InternalLimp.g:3952:5: () ( ( ruleRelationalOp ) )
{
// InternalLimp.g:3952:5: ()
// InternalLimp.g:3953:1:
{
}
// InternalLimp.g:3953:2: ( ( ruleRelationalOp ) )
// InternalLimp.g:3954:1: ( ruleRelationalOp )
{
// InternalLimp.g:3954:1: ( ruleRelationalOp )
// InternalLimp.g:3955:1: ruleRelationalOp
{
pushFollow(FOLLOW_2);
ruleRelationalOp();
state._fsp--;
if (state.failed) return ;
}
}
}
}
}
// $ANTLR end synpred5_InternalLimp
// $ANTLR start synpred6_InternalLimp
public final void synpred6_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:4029:3: ( ( () ( ( ( '+' | '-' ) ) ) ) )
// InternalLimp.g:4029:4: ( () ( ( ( '+' | '-' ) ) ) )
{
// InternalLimp.g:4029:4: ( () ( ( ( '+' | '-' ) ) ) )
// InternalLimp.g:4029:5: () ( ( ( '+' | '-' ) ) )
{
// InternalLimp.g:4029:5: ()
// InternalLimp.g:4030:1:
{
}
// InternalLimp.g:4030:2: ( ( ( '+' | '-' ) ) )
// InternalLimp.g:4031:1: ( ( '+' | '-' ) )
{
// InternalLimp.g:4031:1: ( ( '+' | '-' ) )
// InternalLimp.g:4032:1: ( '+' | '-' )
{
if ( (input.LA(1)>=71 && input.LA(1)<=72) ) {
input.consume();
state.errorRecovery=false;state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return ;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
}
}
}
}
// $ANTLR end synpred6_InternalLimp
// $ANTLR start synpred7_InternalLimp
public final void synpred7_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:4126:3: ( ( () ( ( ( '*' | '/' ) ) ) ) )
// InternalLimp.g:4126:4: ( () ( ( ( '*' | '/' ) ) ) )
{
// InternalLimp.g:4126:4: ( () ( ( ( '*' | '/' ) ) ) )
// InternalLimp.g:4126:5: () ( ( ( '*' | '/' ) ) )
{
// InternalLimp.g:4126:5: ()
// InternalLimp.g:4127:1:
{
}
// InternalLimp.g:4127:2: ( ( ( '*' | '/' ) ) )
// InternalLimp.g:4128:1: ( ( '*' | '/' ) )
{
// InternalLimp.g:4128:1: ( ( '*' | '/' ) )
// InternalLimp.g:4129:1: ( '*' | '/' )
{
if ( (input.LA(1)>=73 && input.LA(1)<=74) ) {
input.consume();
state.errorRecovery=false;state.failed=false;
}
else {
if (state.backtracking>0) {state.failed=true; return ;}
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
}
}
}
}
// $ANTLR end synpred7_InternalLimp
// $ANTLR start synpred8_InternalLimp
public final void synpred8_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:4311:4: ( ( () '.' ) )
// InternalLimp.g:4311:5: ( () '.' )
{
// InternalLimp.g:4311:5: ( () '.' )
// InternalLimp.g:4311:6: () '.'
{
// InternalLimp.g:4311:6: ()
// InternalLimp.g:4312:1:
{
}
match(input,76,FOLLOW_2); if (state.failed) return ;
}
}
}
// $ANTLR end synpred8_InternalLimp
// $ANTLR start synpred9_InternalLimp
public final void synpred9_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:4342:8: ( ( () '{' ( ( RULE_ID ) ) ':=' ) )
// InternalLimp.g:4342:9: ( () '{' ( ( RULE_ID ) ) ':=' )
{
// InternalLimp.g:4342:9: ( () '{' ( ( RULE_ID ) ) ':=' )
// InternalLimp.g:4342:10: () '{' ( ( RULE_ID ) ) ':='
{
// InternalLimp.g:4342:10: ()
// InternalLimp.g:4343:1:
{
}
match(input,26,FOLLOW_6); if (state.failed) return ;
// InternalLimp.g:4344:1: ( ( RULE_ID ) )
// InternalLimp.g:4345:1: ( RULE_ID )
{
// InternalLimp.g:4345:1: ( RULE_ID )
// InternalLimp.g:4346:1: RULE_ID
{
match(input,RULE_ID,FOLLOW_52); if (state.failed) return ;
}
}
match(input,77,FOLLOW_2); if (state.failed) return ;
}
}
}
// $ANTLR end synpred9_InternalLimp
// $ANTLR start synpred10_InternalLimp
public final void synpred10_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:4405:8: ( ( () '[' ) )
// InternalLimp.g:4405:9: ( () '[' )
{
// InternalLimp.g:4405:9: ( () '[' )
// InternalLimp.g:4405:10: () '['
{
// InternalLimp.g:4405:10: ()
// InternalLimp.g:4406:1:
{
}
match(input,32,FOLLOW_2); if (state.failed) return ;
}
}
}
// $ANTLR end synpred10_InternalLimp
// $ANTLR start synpred11_InternalLimp
public final void synpred11_InternalLimp_fragment() throws RecognitionException {
// InternalLimp.g:4435:4: ( ( () ':=' ) )
// InternalLimp.g:4435:5: ( () ':=' )
{
// InternalLimp.g:4435:5: ( () ':=' )
// InternalLimp.g:4435:6: () ':='
{
// InternalLimp.g:4435:6: ()
// InternalLimp.g:4436:1:
{
}
match(input,77,FOLLOW_2); if (state.failed) return ;
}
}
}
// $ANTLR end synpred11_InternalLimp
// Delegated rules
public final boolean synpred6_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred6_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred5_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred5_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred7_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred7_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred3_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred3_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred4_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred4_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred9_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred9_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred10_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred10_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred8_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred8_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred2_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred2_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred11_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred11_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
public final boolean synpred1_InternalLimp() {
state.backtracking++;
int start = input.mark();
try {
synpred1_InternalLimp_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
}
protected DFA2 dfa2 = new DFA2(this);
protected DFA20 dfa20 = new DFA20(this);
protected DFA40 dfa40 = new DFA40(this);
static final String dfa_1s = "\13\uffff";
static final String dfa_2s = "\1\4\2\uffff\1\20\7\uffff";
static final String dfa_3s = "\1\45\2\uffff\1\24\7\uffff";
static final String dfa_4s = "\1\uffff\1\1\1\2\1\uffff\1\5\1\6\1\7\1\10\1\11\1\4\1\3";
static final String dfa_5s = "\13\uffff}>";
static final String[] dfa_6s = {
"\1\2\11\uffff\1\1\1\3\1\4\3\uffff\1\5\2\uffff\1\10\14\uffff\1\6\1\7",
"",
"",
"\1\12\3\uffff\1\11",
"",
"",
"",
"",
"",
"",
""
};
static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s);
static final char[] dfa_2 = DFA.unpackEncodedStringToUnsignedChars(dfa_2s);
static final char[] dfa_3 = DFA.unpackEncodedStringToUnsignedChars(dfa_3s);
static final short[] dfa_4 = DFA.unpackEncodedString(dfa_4s);
static final short[] dfa_5 = DFA.unpackEncodedString(dfa_5s);
static final short[][] dfa_6 = unpackEncodedStringArray(dfa_6s);
class DFA2 extends DFA {
public DFA2(BaseRecognizer recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 2;
this.eot = dfa_1;
this.eof = dfa_1;
this.min = dfa_2;
this.max = dfa_3;
this.accept = dfa_4;
this.special = dfa_5;
this.transition = dfa_6;
}
public String getDescription() {
return "119:1: (this_Import_0= ruleImport | this_Comment_1= ruleComment | this_ExternalFunction_2= ruleExternalFunction | this_ExternalProcedure_3= ruleExternalProcedure | this_LocalFunction_4= ruleLocalFunction | this_LocalProcedure_5= ruleLocalProcedure | this_ConstantDeclaration_6= ruleConstantDeclaration | this_GlobalDeclaration_7= ruleGlobalDeclaration | this_TypeDeclaration_8= ruleTypeDeclaration )";
}
}
static final String dfa_7s = "\14\uffff";
static final String dfa_8s = "\1\5\1\uffff\1\21\11\uffff";
static final String dfa_9s = "\1\117\1\uffff\1\114\11\uffff";
static final String dfa_10s = "\1\uffff\1\1\1\uffff\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\2";
static final String dfa_11s = "\14\uffff}>";
static final String[] dfa_12s = {
"\1\1\1\2\3\1\7\uffff\1\1\14\uffff\2\1\21\uffff\1\10\1\11\1\12\1\3\2\uffff\1\4\1\5\1\7\1\6\2\uffff\1\1\12\uffff\2\1\1\uffff\1\1\2\uffff\2\1",
"",
"\1\1\6\uffff\1\13\1\uffff\1\1\2\uffff\1\13\2\uffff\1\1\5\uffff\1\1\25\uffff\1\1\1\uffff\15\1\1\uffff\1\1",
"",
"",
"",
"",
"",
"",
"",
"",
""
};
static final short[] dfa_7 = DFA.unpackEncodedString(dfa_7s);
static final char[] dfa_8 = DFA.unpackEncodedStringToUnsignedChars(dfa_8s);
static final char[] dfa_9 = DFA.unpackEncodedStringToUnsignedChars(dfa_9s);
static final short[] dfa_10 = DFA.unpackEncodedString(dfa_10s);
static final short[] dfa_11 = DFA.unpackEncodedString(dfa_11s);
static final short[][] dfa_12 = unpackEncodedStringArray(dfa_12s);
class DFA20 extends DFA {
public DFA20(BaseRecognizer recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 20;
this.eot = dfa_7;
this.eof = dfa_7;
this.min = dfa_8;
this.max = dfa_9;
this.accept = dfa_10;
this.special = dfa_11;
this.transition = dfa_12;
}
public String getDescription() {
return "2610:1: (this_VoidStatement_0= ruleVoidStatement | this_AssignmentStatement_1= ruleAssignmentStatement | this_IfThenElseStatement_2= ruleIfThenElseStatement | this_WhileStatement_3= ruleWhileStatement | this_ForStatement_4= ruleForStatement | this_GotoStatement_5= ruleGotoStatement | this_LabelStatement_6= ruleLabelStatement | ( () otherlv_8= 'break' otherlv_9= ';' ) | ( () otherlv_11= 'continue' otherlv_12= ';' ) | ( () otherlv_14= 'return' otherlv_15= ';' ) )";
}
}
static final String dfa_13s = "\16\uffff";
static final String dfa_14s = "\13\uffff\1\15\2\uffff";
static final String dfa_15s = "\1\5\12\uffff\1\4\2\uffff";
static final String dfa_16s = "\1\117\12\uffff\1\115\2\uffff";
static final String dfa_17s = "\1\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\uffff\1\14\1\13";
static final String dfa_18s = "\16\uffff}>";
static final String[] dfa_19s = {
"\1\6\1\13\1\3\1\2\1\5\7\uffff\1\1\14\uffff\1\12\1\11\51\uffff\1\4\4\uffff\1\7\1\10",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\1\15\11\uffff\3\15\1\14\1\15\1\uffff\1\15\2\uffff\1\15\2\uffff\2\15\1\uffff\1\15\2\uffff\2\15\1\uffff\4\15\16\uffff\1\15\6\uffff\1\15\1\uffff\15\15\1\uffff\2\15",
"",
""
};
static final short[] dfa_13 = DFA.unpackEncodedString(dfa_13s);
static final short[] dfa_14 = DFA.unpackEncodedString(dfa_14s);
static final char[] dfa_15 = DFA.unpackEncodedStringToUnsignedChars(dfa_15s);
static final char[] dfa_16 = DFA.unpackEncodedStringToUnsignedChars(dfa_16s);
static final short[] dfa_17 = DFA.unpackEncodedString(dfa_17s);
static final short[] dfa_18 = DFA.unpackEncodedString(dfa_18s);
static final short[][] dfa_19 = unpackEncodedStringArray(dfa_19s);
class DFA40 extends DFA {
public DFA40(BaseRecognizer recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 40;
this.eot = dfa_13;
this.eof = dfa_14;
this.min = dfa_15;
this.max = dfa_16;
this.accept = dfa_17;
this.special = dfa_18;
this.transition = dfa_19;
}
public String getDescription() {
return "4492:1: ( (otherlv_0= '(' this_Expr_1= ruleExpr otherlv_2= ')' ) | ( () ( (lv_boolVal_4_0= RULE_BOOLEAN ) ) ) | ( () ( (lv_intVal_6_0= RULE_INT ) ) ) | ( () otherlv_8= '*' ) | ( () ( (lv_realVal_10_0= RULE_REAL ) ) ) | ( () ( (lv_stringVal_12_0= RULE_STRING ) ) ) | ( () otherlv_14= 'init' ( (otherlv_15= RULE_ID ) ) ) | ( () otherlv_17= 'second_init' ( (otherlv_18= RULE_ID ) ) ) | this_ArrayExpr_19= ruleArrayExpr | this_RecordExpr_20= ruleRecordExpr | ( () ( (otherlv_22= RULE_ID ) ) ) | ( () ( (otherlv_24= RULE_ID ) ) otherlv_25= '(' ( (lv_exprs_26_0= ruleExprList ) ) otherlv_27= ')' ) )";
}
}
public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x000000300091C012L});
public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000000020L});
public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000000040L});
public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000020000L});
public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000040040L});
public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000040000L});
public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000080000L});
public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x0000000000100000L});
public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000100000000000L});
public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000000002200000L});
public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x0000000000200000L});
public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000004000000L});
public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000100002400000L});
public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000100000400000L});
public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000000400000L});
public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000001000000L});
public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x00000F84D0000040L});
public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000008000040L});
public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x0000000010000000L});
public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000028000000L});
public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000040000000L});
public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000000080000000L});
public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000100000000L});
public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000200000000L});
public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x0000000400000000L});
public static final BitSet FOLLOW_30 = new BitSet(new long[]{0x0000000800000000L});
public static final BitSet FOLLOW_31 = new BitSet(new long[]{0x0000000001000002L});
public static final BitSet FOLLOW_32 = new BitSet(new long[]{0x20000000C00203E0L,0x000000000000CB00L});
public static final BitSet FOLLOW_33 = new BitSet(new long[]{0x0000000020000002L});
public static final BitSet FOLLOW_34 = new BitSet(new long[]{0x0000004000000000L});
public static final BitSet FOLLOW_35 = new BitSet(new long[]{0x0001E00008000000L});
public static final BitSet FOLLOW_36 = new BitSet(new long[]{0x0000004020000000L});
public static final BitSet FOLLOW_37 = new BitSet(new long[]{0x279E0000C80203E0L,0x000000000000CB00L});
public static final BitSet FOLLOW_38 = new BitSet(new long[]{0x0020000000000000L});
public static final BitSet FOLLOW_39 = new BitSet(new long[]{0x0040000000000000L});
public static final BitSet FOLLOW_40 = new BitSet(new long[]{0x0010000000000000L});
public static final BitSet FOLLOW_41 = new BitSet(new long[]{0x0800004000000000L});
public static final BitSet FOLLOW_42 = new BitSet(new long[]{0x20000000C80203E0L,0x000000000000CB00L});
public static final BitSet FOLLOW_43 = new BitSet(new long[]{0x1000000000000002L});
public static final BitSet FOLLOW_44 = new BitSet(new long[]{0x0000000020000000L});
public static final BitSet FOLLOW_45 = new BitSet(new long[]{0x4000000000000002L});
public static final BitSet FOLLOW_46 = new BitSet(new long[]{0x8000000000000002L});
public static final BitSet FOLLOW_47 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000001L});
public static final BitSet FOLLOW_48 = new BitSet(new long[]{0x0000000000000002L,0x000000000000007EL});
public static final BitSet FOLLOW_49 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000180L});
public static final BitSet FOLLOW_50 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000600L});
public static final BitSet FOLLOW_51 = new BitSet(new long[]{0x0000000104000002L,0x0000000000001000L});
public static final BitSet FOLLOW_52 = new BitSet(new long[]{0x0000000000000000L,0x0000000000002000L});
public static final BitSet FOLLOW_53 = new BitSet(new long[]{0x0000000008000000L});
public static final BitSet FOLLOW_54 = new BitSet(new long[]{0x0000000200000000L,0x0000000000002000L});
public static final BitSet FOLLOW_55 = new BitSet(new long[]{0x20000000C00603E0L,0x000000000000CB00L});
public static final BitSet FOLLOW_56 = new BitSet(new long[]{0x0000000220000000L});
} |
package com.gestta.gestta_app;
import android.content.Intent;
import android.os.PersistableBundle;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class LoginActivity extends AppCompatActivity {
@BindView(R.id.activity_login_input_user)
protected TextInputLayout inputUser;
@BindView(R.id.activity_login_password_input)
protected TextInputLayout inputPassword;
@BindView(R.id.activity_login_forgot_password_button)
protected Button fogotPasswordButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
if(savedInstanceState != null){
inputUser.getEditText().setText(savedInstanceState.getString("user"));
}
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString("user", inputUser.getEditText().getText().toString());
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
if(savedInstanceState != null){
inputUser.getEditText().setText(savedInstanceState.getString("user"));
}
}
@OnClick(R.id.activity_login_login_button)
protected void performLogin() {
Intent goToMain = new Intent(this, MainActivity.class);
goToMain.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(goToMain);
}
@OnClick(R.id.activity_login_forgot_password_button)
protected void openForgotActivity() {
Intent goToForgotPassword = new Intent(this, ForgotPassActivity.class);
startActivity(goToForgotPassword);
}
}
|
package it.usi.xframe.xas.bfimpl.sms;
import it.usi.xframe.xas.bfimpl.sms.providers.LogData;
import it.usi.xframe.xas.bfutil.data.SmsMessage;
import it.usi.xframe.xas.bfutil.data.SmsSenderInfo;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class SecurityLog
{
private static Log log = LogFactory.getLog(SecurityLog.class);
private static final String LOG_ERROR = "ERR";
private static final String LOG_OK = "OK";
public static final String LOG_LEVEL_NONE = "none";
public static final String LOG_LEVEL_DEFAULT = "default";
public static final String LOG_LEVEL_DEBUG = "full";
private static final String LOG_KEY_LOGPREFIX = "smslogprefix=";
private static final String LOG_KEY_SMSSTATUS = "smsstatus=";
private static final String LOG_KEY_ERRORMESSAGE = "errormessage=";
private static final String LOG_KEY_LOGLEVEL = "dbglevel=";
private static final String LOG_KEY_USERID = "userid=";
private static final String LOG_KEY_SRCALIAS = "srcAlias=";
private static final String LOG_KEY_USEDALIAS = "usedAlias=";
private static final String LOG_KEY_SRCABI = "srcABI=";
private static final String LOG_KEY_USEDABI = "usedABI=";
private static final String LOG_KEY_ORIGINATOR = "originator=";
private static final String LOG_KEY_DSTPHONENUM = "dstphonenumber=";
private static final String LOG_KEY_SMSMESSAGE = "smsmessage=";
private static final String LOG_KEY_SMSID = "smsid=";
private static final String LOG_KEY_SMSPART = "smspart=";
private static final String LOG_KEY_SMSLENGTH = "smslength=";
private static final String LOG_KEY_SMSENC = "smsenc=";
private static final String LOG_KEY_MSGLENGTH = "msglength=";
private static final String LOG_KEY_GATEWAYCONTACTED = "gatewaycontacted=";
private static final String LOG_KEY_TIMEELAPSED = "timeelapsed=";
// this log is used by Security Office
public void securityLog(LogData logData)
{
// smsloglevel: none|default|full
String loglevel = logData.logLevel.toLowerCase();
if ("default".equals(loglevel)){
log(logData.logPrefix, LOG_OK, logData.errorMessage, LOG_LEVEL_DEFAULT
,logData.userid, logData.originalAlias, logData.usedAlias, logData.originalAbiCode, logData.usedAbiCode
,logData.originator, logData.normalizedDestinationNumber, "", logData.smsId
,logData.messageLength, logData.smsEncoding, logData.messagePart, logData.messagePartLength
,logData.gatewayContacted, logData.chrono.getElapsed());
} else if ("full".equals(loglevel)) {
log(logData.logPrefix, LOG_OK, logData.errorMessage, LOG_LEVEL_DEFAULT
,logData.userid, logData.originalAlias, logData.usedAlias, logData.originalAbiCode, logData.usedAbiCode
,logData.originator, logData.normalizedDestinationNumber, logData.originalMsg, logData.smsId
,logData.messageLength, logData.smsEncoding, logData.messagePart, logData.messagePartLength
,logData.gatewayContacted, logData.chrono.getElapsed());
} else {
// default smsloglevel --> none
return;
}
}
public void errorLog(LogData logData)
{
// smsloglevel: none|default|full
String loglevel = logData.logLevel.toLowerCase();
if ("default".equals(loglevel)){
log(logData.logPrefix, LOG_ERROR, logData.errorMessage, LOG_LEVEL_DEFAULT
,logData.userid, logData.originalAlias, logData.usedAlias, logData.originalAbiCode, logData.usedAbiCode
,logData.originator, logData.normalizedDestinationNumber, "", logData.smsId
,logData.messageLength, logData.smsEncoding, logData.messagePart, logData.messagePartLength
,logData.gatewayContacted, logData.chrono.getElapsed());
} else if ("full".equals(loglevel)) {
log(logData.logPrefix, LOG_ERROR, logData.errorMessage, LOG_LEVEL_DEFAULT
,logData.userid, logData.originalAlias, logData.usedAlias, logData.originalAbiCode, logData.usedAbiCode
,logData.originator, logData.normalizedDestinationNumber, logData.originalMsg, logData.smsId
,logData.messageLength, logData.smsEncoding, logData.messagePart, logData.messagePartLength
,logData.gatewayContacted, logData.chrono.getElapsed());
} else {
// default smsloglevel --> none
return;
}
}
// this log is used by Security Office
private void log(String logPrefix, String smsStatus, String errorMessage, String logLevel,
String userid, String srcAlias, String usedAlias, String srcAbiCode, String usedAbiCode,
String originator, String destination, String smsMsg, String smsId,
int smsLength, String smsEncoding, String messagePart, String messagePartLength,
boolean gatewayContacted, long timeElapsed)
{
StringBuffer sb = new StringBuffer();
sb.append(LOG_KEY_LOGPREFIX + "\"" + logPrefix + "\"");
sb.append("," + LOG_KEY_SMSSTATUS + "\"" + normalizeString(smsStatus) + "\"");
sb.append("," + LOG_KEY_ERRORMESSAGE + "\"" + normalizeString(errorMessage) + "\"");
sb.append("," + LOG_KEY_LOGLEVEL + "\"" + logLevel + "\"");
sb.append("," + LOG_KEY_USERID + "\"" + userid + "\"");
sb.append("," + LOG_KEY_SRCALIAS + "\"" + srcAlias + "\"");
sb.append("," + LOG_KEY_USEDALIAS + "\"" + usedAlias + "\"");
sb.append("," + LOG_KEY_SRCABI + "\"" + srcAbiCode + "\"");
sb.append("," + LOG_KEY_USEDABI + "\"" + usedAbiCode + "\"");
sb.append("," + LOG_KEY_ORIGINATOR + "\"" + originator + "\"");
sb.append("," + LOG_KEY_DSTPHONENUM + "\"" + destination + "\"");
sb.append("," + LOG_KEY_SMSMESSAGE + "\"" + normalizeString(smsMsg) + "\"");
sb.append("," + LOG_KEY_SMSID + "\"" + normalizeString(smsId) + "\"");
sb.append("," + LOG_KEY_SMSLENGTH + "\"" + smsLength + "\"");
sb.append("," + LOG_KEY_SMSENC + "\"" + smsEncoding + "\"");
sb.append("," + LOG_KEY_SMSPART + "\"" + messagePart + "\"");
sb.append("," + LOG_KEY_MSGLENGTH + "\"" + messagePartLength + "\"");
sb.append("," + LOG_KEY_GATEWAYCONTACTED + "\"" + gatewayContacted + "\"");
sb.append("," + LOG_KEY_TIMEELAPSED + "\"" + Chronometer.formatMillis(timeElapsed) + "\"");
log.info(sb);
}
private String normalizeString(String value)
{
if(value==null)
return null;
StringBuffer normal = new StringBuffer("");
for (int i=0; i<value.length(); ++i)
{
String a = value.substring(i,i+1);
if(a.equals("\""))
normal.append("'");
else
normal.append( a );
}
return normal.toString();
}
/*
* THE NETX METHODS MAY BE DELETED
*/
public void securityLog(String logPrefix,
SmsMessage sms,
SmsSenderInfo sender,
String status,
String smsloglevel,
String userid)
{
String usedAbi = null;
String usedAlias = null;
if(sender!=null) {
usedAbi = sender.getABICode();
usedAlias = sender.getAlias();
}
securityLog(logPrefix, sms, sender, status, smsloglevel, userid, null, usedAbi, usedAlias, "", "");
}
// this log is used by Security Office
public void securityLog(String logPrefix,
SmsMessage sms,
SmsSenderInfo sender,
String status,
String smsloglevel,
String userid,
String originator,
String usedABI,
String usedAlias,
String msgid,
String userdata)
{
// common logging utility
StringBuffer sb = new StringBuffer();
sb.append("smslogprefix=" + logPrefix);
sb.append(",smsstatus=OK");
// sender info
String srcAlias = (sender!=null) ?sender.getAlias() :null;
String srcABI = (sender!=null) ?sender.getABICode() :null;
// smsloglevel: none|default|full
String loglevel = smsloglevel.toLowerCase();
if ("default".equals(loglevel)){
sb.append("," + LOG_KEY_LOGLEVEL + LOG_LEVEL_DEFAULT);
sb.append(",userid=" + userid);
sb.append(",srcAlias=" + srcAlias);
sb.append(",usedAlias=" + usedAlias);
sb.append(",srcABI=" + srcABI);
sb.append(",usedABI=" + usedABI);
sb.append(",originator=" + originator);
sb.append(",dstphonenumber=" + sms.getPhoneNumber());
sb.append(",smsgatewayresponse=" + normalizeString(status));
sb.append(",smsid=" + normalizeString(msgid));
sb.append("," + normalizeString(userdata));
} else if ("full".equals(loglevel)) {
sb.append("," + LOG_KEY_LOGLEVEL + LOG_LEVEL_DEBUG);
sb.append(",userid=" + userid);
sb.append(",srcAlias=" + srcAlias);
sb.append(",usedAlias=" + usedAlias);
sb.append(",srcABI=" + srcABI);
sb.append(",usedABI=" + usedABI);
sb.append(",originator=" + originator);
sb.append(",dstphonenumber=" + sms.getPhoneNumber());
sb.append(",smsmessage=" + normalizeString(sms.getMsg()));
sb.append(",smsgatewayresponse=" + normalizeString(status));
sb.append(",smsid=" + msgid);
sb.append("," + normalizeString(userdata));
} else {
// default smsloglevel --> none
return;
}
log.info(sb);
}
public void errorLog(String errMsg,
String logPrefix,
SmsMessage sms,
SmsSenderInfo sender,
String smsloglevel,
String userid)
{
String usedAbi = null;
String usedAlias = null;
if(sender!=null) {
usedAbi = sender.getABICode();
usedAlias = sender.getAlias();
}
errorLog(errMsg, logPrefix, sms, sender, smsloglevel, userid, null, usedAbi, usedAlias, "", "");
}
// this log is used by Security Office
public void errorLog(String errMsg,
String logPrefix,
SmsMessage sms,
SmsSenderInfo sender,
String smsloglevel,
String userid,
String originator,
String usedABI,
String usedAlias,
String msgid,
String userdata)
{
// common logging utility
StringBuffer sb = new StringBuffer();
sb.append("smslogprefix=" + logPrefix);
sb.append(",smsstatus=ERR");
sb.append(",errormessage=" + errMsg);
// sender info
String srcAlias = (sender!=null) ?sender.getAlias() :null;
String srcABI = (sender!=null) ?sender.getABICode() :null;
// smsloglevel: none|default|full
String loglevel = smsloglevel.toLowerCase();
if ("default".equals(loglevel)){
sb.append("," + LOG_KEY_LOGLEVEL + LOG_LEVEL_DEFAULT);
sb.append(",userid=" + userid);
sb.append(",srcAlias=" + srcAlias);
sb.append(",usedAlias=" + usedAlias);
sb.append(",srcABI=" + srcABI);
sb.append(",usedABI=" + usedABI);
sb.append(",originator=" + originator);
sb.append(",dstphonenumber=" + sms.getPhoneNumber());
sb.append(",smsid=" + normalizeString(msgid));
sb.append("," + normalizeString(userdata));
} else if ("full".equals(loglevel)) {
sb.append("," + LOG_KEY_LOGLEVEL + LOG_LEVEL_DEBUG);
sb.append(",userid=" + userid);
sb.append(",srcAlias=" + srcAlias);
sb.append(",usedAlias=" + usedAlias);
sb.append(",srcABI=" + srcABI);
sb.append(",usedABI=" + usedABI);
sb.append(",originator=" + originator);
sb.append(",dstphonenumber=" + sms.getPhoneNumber());
sb.append(",smsmessage=" + normalizeString(sms.getMsg()));
sb.append(",smsid=" + normalizeString(msgid));
sb.append("," + normalizeString(userdata));
} else {
// default smsloglevel --> none
return;
}
log.info(sb);
}
}
|
package com.xxx;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
@Service
public class BookServiceImpl implements BookService {
// 使用递增方式生成 id后缀
private AtomicLong idGenerator = new AtomicLong(0L);
// 这里并没有使用持久化存储,而是使用该 List将图书信息保存在内存中
private static List<Book> books = Lists.newCopyOnWriteArrayList();
@Override
public Book getBookById(String id) {
return books.stream().filter(b -> b.getId().equals(id))
.findFirst().orElse(null);
}
@Override
public List<Book> list() {
return books;
}
@Override
public Book createBook(BookInput input) {
String id = "book-" + idGenerator.getAndIncrement();
Book book = new Book();
book.setId(id);
book.setName(input.getName());
book.setPageCount(input.getPageCount());
book.setAuthorId(input.getAuthorId());
books.add(book);
return book;
}
}
|
package src;
public class vueListeAgences {
}
|
/*
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. Thanks Marcos for contributing this image!
Example:
Input: [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6
*/
class Solution {
public int trap(int[] height) {
if (height.length < 1) return 0;
int res = 0;
int lh = height[0];
int rh = height[height.length - 1];
int l = 0;
int r = height.length - 1;
while (l < r) {
if (lh < rh) {
while (l < r && height[l] <= lh) {
res += lh - height[l];
l++;
}
lh = height[l];
} else {
while (l < r && height[r] <= rh) {
res += rh - height[r];
r--;
}
rh = height[r];
}
}
return res;
}
}
|
package com.legalzoom.api.test.integration.ProductsService;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.legalzoom.api.test.client.ResponseData;
import com.legalzoom.api.test.dto.CreatePriceChangeReasonIdDTO;
public class CoreProductsReferencesPriceChangeReasonsGetIT extends ProductsTest{
@Test
public void testReferencesComponentTypesAll() throws Exception{
ResponseData responseData = coreProductsServiceClient.getCoreProductsReferencesPriceChangeReasons();
Assert.assertEquals(responseData.getStatus(), 200);
}
} |
package at.cooperation.rezeptdb;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import at.cooperation.rezeptdb.service.Settings;
/**
* A login screen that offers login via email/password.
*/
public class SettingsActivity extends Activity {
// UI references.
private EditText mServerView;
private EditText mUsernameView;
private EditText mPasswordView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
// Set up the login form.
mServerView = findViewById(R.id.url);
mServerView.setText(Settings.getInstance(this).getBaseUrl());
mUsernameView = findViewById(R.id.username);
mUsernameView.setText(Settings.getInstance(this).getUsername());
mPasswordView = findViewById(R.id.password);
mPasswordView.setText(Settings.getInstance(this).getPassword());
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
if (id == EditorInfo.IME_ACTION_DONE || id == EditorInfo.IME_NULL) {
saveSettings();
return true;
}
return false;
}
});
Button mEmailSignInButton = findViewById(R.id.sign_in);
mEmailSignInButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
saveSettings();
}
});
}
/**
* Attempts to sign in or register the account specified by the login form.
* If there are form errors (invalid email, missing fields, etc.), the
* errors are presented and no actual login attempt is made.
*/
private void saveSettings() {
// Reset errors.
mUsernameView.setError(null);
mPasswordView.setError(null);
// Store values at the time of the login attempt.
String url = mServerView.getText().toString();
String username = mUsernameView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
if (TextUtils.isEmpty(url)) {
mServerView.setError(getString(R.string.error_field_required));
focusView = mServerView;
cancel = true;
}
if (TextUtils.isEmpty(username)) {
mUsernameView.setError(getString(R.string.error_field_required));
focusView = mUsernameView;
cancel = true;
}
if (TextUtils.isEmpty(password)) {
mPasswordView.setError(getString(R.string.error_field_required));
focusView = mPasswordView;
cancel = true;
}
if (cancel) {
focusView.requestFocus();
} else {
Settings.getInstance(this).setBaseUrl(url);
Settings.getInstance(this).setUsername(username);
Settings.getInstance(this).setPassword(password);
startActivity(new Intent(this, SettingsCheckActivity.class));
}
}
@Override
public void onBackPressed() {
//do nothing.
}
}
|
package com.gmail.merikbest2015.ecommerce.domain.dto;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Value;
import java.util.Set;
/**
* Data Transfer Object class which receives responses from google services.
* The response is a JSON object.
* The @Value annotation generates getters and setters.
* The @JsonIgnoreProperties annotation indicate that any properties not bound in this type should be ignored.
*
* @author Miroslav Khotinskiy (merikbest2015@gmail.com)
* @version 1.0
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class CaptchaResponseDto {
/**
* Successful status from response.
*/
private boolean success;
/**
* Errors from response.
* The @JsonAlias annotation used to define one or more alternative names for property,
* accepted during deserialization as alternative to the official name.
*/
@JsonAlias("error-codes")
private Set<String> errorCodes;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public Set<String> getErrorCodes() {
return errorCodes;
}
public void setErrorCodes(Set<String> errorCodes) {
this.errorCodes = errorCodes;
}
}
|
package com.bbb.composite.product.details.dto;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import com.bbb.composite.product.details.dto.product.BazaarVoiceProductDTO;
import com.bbb.composite.product.details.dto.product.MediaDTO;
import com.bbb.composite.product.details.dto.product.TabDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* ProductCompositeDTO attributes specified here.
*
* @author psh111
*
*/
public class ProductCompositeDTO implements Serializable{
/**
*
*/
private static final long serialVersionUID = -2749573216411206218L;
private String productId;
private String name;
private BrandCompositeDTO productBrand;
private String shortDescription;
private String longDescription;
private String seoURL;
private String siteId;
private ImageDTO productImages;
private List<MediaDTO> productMedia;
private ProductPriceCompositeDTO price;
private Map<String, List<AttributeDTO>> attributesList;
private List<TabDTO> productTabs;
private String shopGuideId;
private Boolean intlRestricted;
private String displayShipMsg;
private List<SkuCompositeDTO> skus;
private BazaarVoiceProductDTO reviews;
private VariantOptionsDTO variantOptions;
private List<String> altImagesList;
private List<CategorySummaryDTO> categoryList;
@JsonIgnore
private List<String> childSKUs;
@JsonIgnore
private boolean isFallBackCalled;
public VariantOptionsDTO getVariantOptions() {
return variantOptions;
}
public void setVariantOptions(VariantOptionsDTO variantOptions) {
this.variantOptions = variantOptions;
}
public boolean isFallBackCalled() {
return isFallBackCalled;
}
public void setFallBackCalled(boolean isFallBackCalled) {
this.isFallBackCalled = isFallBackCalled;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLongDescription() {
return longDescription;
}
public void setLongDescription(String longDescription) {
this.longDescription = longDescription;
}
public String getSeoURL() {
return seoURL;
}
public void setSeoURL(String seoURL) {
this.seoURL = seoURL;
}
public String getShopGuideId() {
return shopGuideId;
}
public void setShopGuideId(String shopGuideId) {
this.shopGuideId = shopGuideId;
}
public Boolean getIntlRestricted() {
return intlRestricted;
}
public void setIntlRestricted(Boolean intlRestricted) {
this.intlRestricted = intlRestricted;
}
public List<TabDTO> getProductTabs() {
return productTabs;
}
public void setProductTabs(List<TabDTO> productTabs) {
this.productTabs = productTabs;
}
public List<MediaDTO> getProductMedia() {
return productMedia;
}
public void setProductMedia(List<MediaDTO> productMedia) {
this.productMedia = productMedia;
}
public Map<String, List<AttributeDTO>> getAttributesList() {
return attributesList;
}
public void setAttributesList(Map<String, List<AttributeDTO>> attributesList) {
this.attributesList = attributesList;
}
public ImageDTO getProductImages() {
return productImages;
}
public void setProductImages(ImageDTO productImages) {
this.productImages = productImages;
}
public BazaarVoiceProductDTO getReviews() {
return reviews;
}
public void setReviews(BazaarVoiceProductDTO reviews) {
this.reviews = reviews;
}
public String getShortDescription() {
return shortDescription;
}
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
public ProductPriceCompositeDTO getPrice() {
return price;
}
public void setPrice(ProductPriceCompositeDTO price) {
this.price = price;
}
public List<SkuCompositeDTO> getSkus() {
return skus;
}
public void setSkus(List<SkuCompositeDTO> skus) {
this.skus = skus;
}
public List<String> getChildSKUs() {
return childSKUs;
}
public void setChildSKUs(List<String> childSKUs) {
this.childSKUs = childSKUs;
}
public String getDisplayShipMsg() {
return displayShipMsg;
}
public void setDisplayShipMsg(String displayShipMsg) {
this.displayShipMsg = displayShipMsg;
}
public BrandCompositeDTO getProductBrand() {
return productBrand;
}
public void setProductBrand(BrandCompositeDTO productBrand) {
this.productBrand = productBrand;
}
public String getSiteId() {
return siteId;
}
public void setSiteId(String siteId) {
this.siteId = siteId;
}
public List<String> getAltImagesList() {
return altImagesList;
}
public void setAltImagesList(List<String> altImagesList) {
this.altImagesList = altImagesList;
}
/**
* @return the categoryList
*/
public final List<CategorySummaryDTO> getCategoryList() {
return categoryList;
}
/**
* @param categoryList the categoryList to set
*/
public final void setCategoryList(List<CategorySummaryDTO> categoryList) {
this.categoryList = categoryList;
}
}
|
package form;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import model.Request;
import model.User;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Path;
import org.zkoss.zk.ui.event.ForwardEvent;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Button;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Include;
import org.zkoss.zul.Label;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.Popup;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;
import constant.ReqStatusConstant;
import constant.ReqTypeConstant;
import services.GeneralService;
import services.PersonnelService;
import util.DateUtil;
import util.MessageUtil;
import util.SessionUtil;
import util.ZKUtil;
public class RequestHistoryBackup extends GenericForwardComposer{
Listbox openBox, closedBox,infoBox;
Window winReqHist;
Include content = (Include) Path.getComponent("//main/content");
Popup infoPopup;
Combobox cbOpenSearchType,cbClosedSearchType;
Textbox txOpenSearchVal,txClosedSearchVal;
User u;
List<Request> allReq, openReq, closedReq,selReq, searchOpenReq, searchClosedReq;
public void doAfterCompose(Component win) throws Exception{
super.doAfterCompose(win);
getDataFromSession();
renderListBox();
cbClosedSearchType.setSelectedIndex(0);
cbOpenSearchType.setSelectedIndex(0);
}
private void getDataFromSession() {
u = SessionUtil.getUser();
}
private void getRequest() {
// Getting all request
allReq = GeneralService.getAllRequestList(u.getEmpNo());
openReq = new ArrayList<Request>();
closedReq = new ArrayList<Request>();
//split request into two, open and closed
if(allReq != null && allReq.size() > 0){
for(Request r: allReq){
if(r.getStatus().equals("Submit")){
openReq.add(r);
}
else{
closedReq.add(r);
}
}
}
}
private void renderListBox() {
getRequest();
openBox.getItems().clear();
closedBox.getItems().clear();
if(openReq!=null && openReq.size()>0){
renderOpenBox(openReq);
}
if(closedReq!=null && closedReq.size()>0){
renderClosedBox(closedReq);
}
}
private void renderOpenBox(List<Request> reqList) {
// TODO Auto-generated method stub
Listcell cell;
Listitem item;
openBox.getItems().clear();
for(Request r: reqList){
item = new Listitem();
cell = new Listcell(r.getReqId());
cell.setParent(item);
cell = new Listcell(DateUtil.getStdDateDisplayWithTime(r.getReqDate()));
cell.setParent(item);
cell = new Listcell(r.getReqType());
cell.setParent(item);
cell = new Listcell();
Hbox box = new Hbox();
Button btnDetail = new Button("Detail");
Button btnCancel = new Button("Cancel");
Button btnStatus = new Button("Status");
btnDetail.addForward("onClick", winReqHist, "onClickDetail", btnDetail);
btnCancel.addForward("onClick", winReqHist, "onCancelReq", btnCancel);
btnStatus.addForward("onClick", winReqHist, "onClickStatus", btnStatus);
btnStatus.setPopup("infoPopup, position=middle_center");
btnDetail.setParent(box);
btnCancel.setParent(box);
btnStatus.setParent(box);
box.setParent(cell);
cell.setParent(item);
item.setAttribute("object", r);
item.setParent(openBox);
}
}
public void onClickDetail$winReqHist(ForwardEvent evt){
Button btn = (Button) evt.getOrigin().getData();
Request r = (Request) btn.getParent().getParent().getParent().getAttribute("object");
String status = r.getStatus().equals(ReqStatusConstant.SUBMIT)?"active":"closed";
String target = "";
if(!r.getReqType().equals(ReqTypeConstant.ACKNOWLEDGE)){
target = ZKUtil.getUrlTargetFromReqType(r.getReqType());
}
else {
if (status.equals("closed")){
target = "acknowledge-receipt";
}
else {
target = "acknowledge-sender";
}
}
if(!target.isEmpty()){
content.setSrc
("WEB-INF/content/"+ target +"-form.zul?reqId="+r.getReqId()+"&userType=requester&reqStatus="+status);
}
}
public void onClickStatus$winReqHist(ForwardEvent evt){
Button btn = (Button) evt.getOrigin().getData();
Request r = (Request) btn.getParent().getParent().getParent().getAttribute("object");
List<Map<String, String>> maps = GeneralService.getListApproverStatus(r.getReqId());
if(maps != null && maps.size() > 0){
ZKUtil.renderApproverStatusInfoBox(maps,infoBox);
}
}
public void onCancelReq$winReqHist(ForwardEvent evt){
if (!MessageUtil.confirmation(MessageUtil.getConfirmationCancelRequest())){
return;
}
Button btn = (Button) evt.getOrigin().getData();
Request r = (Request) btn.getParent().getParent().getParent().getAttribute("object");
GeneralService.updateRequestStatus(r.getReqId(), ReqStatusConstant.CANCELED, "", "", u.getEmpNo());
MessageUtil.information("Request canceled");
renderListBox();
}
private void renderClosedBox(List<Request> reqList) {
Listcell cell;
Listitem item;
closedBox.getItems().clear();
for(Request r: reqList){
item = new Listitem();
cell = new Listcell(r.getReqId());
cell.setParent(item);
cell = new Listcell(DateUtil.getStdDateDisplayWithTime(r.getReqDate()));
cell.setParent(item);
cell = new Listcell(r.getReqType());
cell.setParent(item);
cell = new Listcell(r.getStatus());
cell.setParent(item);
cell = new Listcell();
Hbox box = new Hbox();
Button btnDetail = new Button("Detail");
Button btnStatus = new Button("Status");
btnDetail.addForward("onClick", winReqHist, "onClickDetail", btnDetail);
btnStatus.addForward("onClick", winReqHist, "onClickStatus", btnStatus);
btnStatus.setPopup("infoPopup, position=middle_center");
btnDetail.setParent(box);
btnStatus.setParent(box);
box.setParent(cell);
cell.setParent(item);
item.setAttribute("object", r);
item.setParent(closedBox);
}
}
public void onClose$infoPopup(){
infoBox.getChildren().clear();
infoBox.invalidate();
}
public void onClick$btnOpenSearch(){
String searchVal = txOpenSearchVal.getValue();
int index = cbOpenSearchType.getSelectedIndex();
searchOpenReq = new ArrayList<Request>();
for (Request r: openReq){
if(index == 0){
//search by req id
if(r.getReqId().toLowerCase().contains(searchVal.toLowerCase())){
searchOpenReq.add(r);
}
}
else if(index == 1){
//search by request type
if(r.getReqType().toLowerCase().contains(searchVal.toLowerCase())){
searchOpenReq.add(r);
}
}
}
renderOpenBox(searchOpenReq);
}
public void onClick$btnClosedSearch(){
String searchVal = txClosedSearchVal.getValue();
int index = cbClosedSearchType.getSelectedIndex();
searchClosedReq = new ArrayList<Request>();
for (Request r: closedReq){
if(index == 0){
//search by req id
if(r.getReqId().toLowerCase().contains(searchVal.toLowerCase())){
searchClosedReq.add(r);
}
}
else if(index == 1){
//search by requester status
if(r.getStatus().toLowerCase().contains(searchVal.toLowerCase())){
searchClosedReq.add(r);
}
}
else if(index == 2){
//search by request type
if(r.getReqType().toLowerCase().contains(searchVal.toLowerCase())){
searchClosedReq.add(r);
}
}
}
renderClosedBox(searchClosedReq);
}
}
|
package com.google.android.gms.common.api;
import com.google.android.gms.common.api.a.b;
import com.google.android.gms.common.api.m.i;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
class m$f extends i {
final /* synthetic */ m aLa;
private final ArrayList<b> aLn;
public m$f(m mVar, ArrayList<b> arrayList) {
this.aLa = mVar;
super(mVar, (byte) 0);
this.aLn = arrayList;
}
public final void oI() {
Set set = this.aLa.aKG.aLy;
Set oQ = set.isEmpty() ? this.aLa.oQ() : set;
Iterator it = this.aLn.iterator();
while (it.hasNext()) {
((b) it.next()).a(this.aLa.aKU, oQ);
}
}
}
|
package com.mimi.mimigroup.ui.adapter;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.mimi.mimigroup.R;
import com.mimi.mimigroup.db.DBGimsHelper;
import com.mimi.mimigroup.model.DM_Tree;
import com.mimi.mimigroup.model.DM_TreeStages;
import com.mimi.mimigroup.model.DM_Tree_Disease;
import com.mimi.mimigroup.model.SM_ReportTechDisease;
import com.mimi.mimigroup.ui.custom.CustomTextView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ReportTechDiseaseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
private DBGimsHelper mDB = null;
public void setsmoReportTechDisease(List<SM_ReportTechDisease> smoReportTechDisease) {
this.smoReportTechDisease = smoReportTechDisease;
notifyDataSetChanged();
}
List<SM_ReportTechDisease> smoReportTechDisease;
public List<SM_ReportTechDisease> SelectedList = new ArrayList<>();
public interface ListItemClickListener{
void onItemClick(List<SM_ReportTechDisease> SelectList);
}
private final ReportTechDiseaseAdapter.ListItemClickListener mOnItemClicked;
public ReportTechDiseaseAdapter(ReportTechDiseaseAdapter.ListItemClickListener mOnClickListener) {
smoReportTechDisease = new ArrayList<>();
this.mOnItemClicked=mOnClickListener;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
mDB = DBGimsHelper.getInstance(viewGroup.getContext());
return new ReportTechDiseaseHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.fragment_report_tech_disease_item,viewGroup,false));
}
@Override
public void onBindViewHolder( final RecyclerView.ViewHolder viewHolder,final int iPos) {
if(viewHolder instanceof ReportTechDiseaseAdapter.ReportTechDiseaseHolder){
((ReportTechDiseaseHolder) viewHolder).bind(smoReportTechDisease.get(iPos));
}
setRowSelected(SelectedList.contains(smoReportTechDisease.get(iPos)),viewHolder);
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(SelectedList.contains(smoReportTechDisease.get(iPos))){
SelectedList.remove(smoReportTechDisease.get(iPos));
setRowSelected(false,viewHolder);
clearSelected();
}else{
SelectedList.add(smoReportTechDisease.get(iPos));
setRowSelected(true,viewHolder);
}
mOnItemClicked.onItemClick(SelectedList);
}
});
viewHolder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
return false;
}
});
}
@Override
public int getItemCount() {
if(smoReportTechDisease != null) {
return smoReportTechDisease.size();
}
return 0;
}
public void clearSelected(){
SelectedList.clear();
notifyDataSetChanged();
}
class ReportTechDiseaseHolder extends RecyclerView.ViewHolder {
@BindView(R.id.tvTreeCode)
CustomTextView tvTreeCode;
@BindView(R.id.tvStages)
CustomTextView tvStages;
@BindView(R.id.tvTitle)
CustomTextView tvTitle;
@BindView(R.id.tvAcreage)
CustomTextView tvAcreage;
@BindView(R.id.tvDisease)
CustomTextView tvDisease;
@BindView(R.id.tvPrice)
CustomTextView tvPrice;
@BindView(R.id.tvNotes)
CustomTextView tvNotes;
public ReportTechDiseaseHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public void bind(SM_ReportTechDisease oDetail){
if(oDetail != null){
if(oDetail.getTreeCode() != null){
DM_Tree tree = mDB.getTreeByCode(oDetail.getTreeCode());
if(tree != null){
tvTreeCode.setText(tree.getTreeName());
}else{
tvTreeCode.setText("");
}
}
if(oDetail.getStagesCode() != null){
DM_TreeStages stages = mDB.getTreeStagesByCode(oDetail.getStagesCode());
if(stages != null){
tvStages.setText(stages.getStagesName());
}else{
tvStages.setText("");
}
}
if(oDetail.getTitle() != null){
tvTitle.setText(oDetail.getTitle());
}
if(oDetail.getAcreage() != null)
{
tvAcreage.setText(oDetail.getAcreage().toString());
}
if(oDetail.getDisease() != null)
{
String diseaseCodes = oDetail.getDisease();
String[] diseaseCode = diseaseCodes.split(",");
String diseaseName = "";
if(diseaseCode.length > 0){
List<DM_Tree_Disease> lst = mDB.getTreeDiseasesByCode(diseaseCode);
for(int i = 0; i < lst.size(); i++){
if(lst.get(i) != null) {
if(i > 0){
diseaseName += ",";
}
diseaseName += lst.get(i).getDiseaseName();
}
}
}
if(diseaseName.length() > 0){
tvDisease.setText(diseaseName);
}else{
tvDisease.setText("");
}
}
if(oDetail.getPrice() != null)
{
tvPrice.setText(oDetail.getPrice().toString());
}
if(oDetail.getNotes() != null){
tvNotes.setText(oDetail.getNotes());
}
}
}
}
private void setRowSelected(boolean isSelected,RecyclerView.ViewHolder viewHolder){
if(isSelected){
viewHolder.itemView.setBackgroundColor(Color.parseColor("#F8D8E7"));
viewHolder.itemView.setSelected(true);
}else {
viewHolder.itemView.setBackgroundColor(Color.parseColor("#ffffff"));
viewHolder.itemView.setSelected(false);
}
}
}
|
package com.demo.test.dto;
import com.solo.sell.dataobject.OrderDetail;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.math.BigDecimal;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class OrderDetailRepositoryTest {
@Autowired
OrderDetailRepository repository;
@Test
public void saveTest(){
OrderDetail orderDetail = new OrderDetail();
orderDetail.setDetailId("111111");
orderDetail.setOrderId("1234567");
orderDetail.setProductIcon("http://xxxxxx.png");
orderDetail.setProductId("qwert");
orderDetail.setProductName("紫菜蛋花汤");
orderDetail.setProductPrice(new BigDecimal(12.0));
orderDetail.setProductQuantity(10);
OrderDetail result = repository.save(orderDetail);
Assert.assertNotNull(result);
}
@Test
public void findByOrderId() {
List<OrderDetail> list = repository.findByOrderId("1234567");
Assert.assertNotEquals(0, list.size());
}
} |
package com.dreamcatcher.admin.model.dao;
import java.util.List;
import java.util.Map;
import com.dreamcatcher.admin.model.StatisticsDto;
public interface AdminDao {
public int memberStateChange(Map memberStateMap);
public int siteStateChange(Map siteStateMap);
public List<StatisticsDto> locationRankByRecommend(int range);
public List<StatisticsDto> siteRankByRecommend(int range);
public List<StatisticsDto> siteRankByRoute(int range);
}
|
package com.web.TestNgRltd;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
public class FailedScreenShot {
public static void captureScreenShots(WebDriver driver,String scrnShotName) throws IOException{
TakesScreenshot ts=(TakesScreenshot)driver;
File src=ts.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(src, new File("./ScreenShots/"+scrnShotName+".png"));
System.out.println("Screen shot taken");
}
}
|
package com.robotarm.core.arduino;
public class SensorDataHandler {
}
|
package com.github.baloise.rocketchatrestclient.model;
import com.fasterxml.jackson.annotation.JsonGetter;
public class AttachmentField {
private boolean isShort = false;
private String title, value;
public void setShort(boolean isShort) {
this.isShort = isShort;
}
@JsonGetter("short")
public boolean isShort() {
return this.isShort;
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
return this.title;
}
public void setValue(String value) {
this.value = value;
}
public String getValue() {
return this.value;
}
}
|
package com.naveen.spring.batch.springbatchcsv.model;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
@Data
@NoArgsConstructor
@Entity
public class User {
@Id
private Integer id;
private String name;
private String dept;
private Integer salary;
}
|
package il.ac.tau.cs.sw1.ex9.starfleet;
public class Cylon extends myAbstractCrewMember {
private int modelNumber;
public Cylon(String name, int age, int yearsInService, int modelNumber) {
super(age,yearsInService,name);
this.modelNumber = modelNumber;
}
public int getModelNumber() {
return this.modelNumber;
}
@Override
public String toString() {
return "Cylon" + System.lineSeparator() + super.toString() + System.lineSeparator() +
"\tModelNumber=" + this.modelNumber;
}
}
|
package pattern_test.adapter.class_adapter;
/**
* Description:
*
* @author Baltan
* @date 2019-04-02 14:46
*/
public class Test1 {
public static void main(String[] args) {
StandardVoltage standardVoltage = new StandardVoltage();
standardVoltage.standardOutput();
Adapter adapter = new Adapter();
adapter.standardOutput();
}
}
|
package com.prokarma.reference.architecture.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
public class Event implements Serializable{
@SerializedName("name")
@Expose
public String name;
@SerializedName("type")
@Expose
public String type;
@SerializedName("id")
@Expose
public String id;
@SerializedName("test")
@Expose
public Boolean test;
@SerializedName("url")
@Expose
public String url;
@SerializedName("locale")
@Expose
public String locale;
@SerializedName("images")
@Expose
public List<Image> images = null;
@SerializedName("sales")
@Expose
public Sales sales;
@SerializedName("dates")
@Expose
public Dates dates;
@SerializedName("classifications")
@Expose
public List<Classification> classifications = null;
@SerializedName("promoter")
@Expose
public Promoter promoter;
@SerializedName("promoters")
@Expose
public List<Promoter> promoters = null;
@SerializedName("outlets")
@Expose
public List<Outlet> outlets = null;
@SerializedName("seatmap")
@Expose
public Seatmap seatmap;
@SerializedName("_links")
@Expose
public Links links;
@SerializedName("_embedded")
@Expose
public EmbeddedEvents embedded;
@SerializedName("priceRanges")
@Expose
public List<PriceRange> priceRanges = null;
@SerializedName("ticketLimit")
@Expose
public TicketLimit ticketLimit;
}
|
package com.flute.atp.domain.model.runtime.event;
import com.flute.atp.common.Category;
import com.flute.atp.common.Rule;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class FlowTrapedEvent extends FlowEvent {
public Rule rule;
public FlowTrapedEvent(String ruleGroupId, String flowId, Category category, Rule rule) {
super(ruleGroupId, flowId, category);
this.rule = rule;
}
public FlowTrapedEvent(Rule rule) {
this.rule = rule;
}
}
|
package com.shopware.test.pages.base;
public interface ProfileEditConstants {
public String TITLE_NAME_PAGE = "Profile | Customer account | QA Test Shop";
public String PROFILE_GREEN_ALERT_MESSAGE = "Your profile has been saved successfully.";
public String PASSWORD_GREEN_ALERT_MESSAGE = "Your password has been changed successfully.";
}
|
package com.union.design.generator.mybatis;
import lombok.Builder;
import lombok.Data;
import java.util.List;
@Builder
@Data
public class MybatisMapperXml {
private String packageName;
private String className;
private String tableName;
private List<MybatisResultMap> resultMaps;
} |
package it.unical.asd.group6.computerSparePartsCompany.data.dto;
import java.io.Serializable;
import java.time.LocalDate;
public class EmployeeDTO implements Serializable {
private Long id;
private String username;
private String password;
private String firstname;
private String lastname;
private LocalDate hiringDate;
private String email;
private String telephoneNumber;
public EmployeeDTO() {}
public EmployeeDTO(Long id, String username, String password, String firstname, String lastname, LocalDate hiringDate, String email, String telephoneNumber) {
this.id = id;
this.username = username;
this.password = password;
this.firstname = firstname;
this.lastname = lastname;
this.hiringDate = hiringDate;
this.email = email;
this.telephoneNumber = telephoneNumber;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public LocalDate getHiringDate() {
return hiringDate;
}
public void setHiringDate(LocalDate hiringDate) {
this.hiringDate = hiringDate;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTelephoneNumber() {
return telephoneNumber;
}
public void setTelephoneNumber(String telephone_number) {
this.telephoneNumber = telephone_number;
}
@Override
public String toString() {
return "EmployeeDTO{" +
"id=" + id +
", username='" + username + '\'' +
", password='" + password + '\'' +
", firstname='" + firstname + '\'' +
", lastname='" + lastname + '\'' +
", hiringDate=" + hiringDate +
", email='" + email + '\'' +
", telephoneNumber='" + telephoneNumber + '\'' +
'}';
}
}
|
package com.tencent.mm.plugin.appbrand;
import com.tencent.mm.plugin.appbrand.config.AppBrandLaunchReferrer;
class j$1 extends j {
j$1() {
}
public final AppBrandLaunchReferrer aaD() {
return null;
}
}
|
package network.codex.codexjavarpcprovider.error;
import network.codex.codexjava.error.rpcProvider.RpcProviderError;
import org.jetbrains.annotations.NotNull;
/**
* Error thrown when there is an issue initializing the RPC Provider.
*/
public class CodexJavaRpcProviderInitializerError extends RpcProviderError {
public CodexJavaRpcProviderInitializerError() {
}
public CodexJavaRpcProviderInitializerError(
@NotNull String message) {
super(message);
}
public CodexJavaRpcProviderInitializerError(
@NotNull String message,
@NotNull Exception exception) {
super(message, exception);
}
public CodexJavaRpcProviderInitializerError(
@NotNull Exception exception) {
super(exception);
}
}
|
package com.example.sitegitfirebase;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.messaging.FirebaseMessaging;
import java.util.Date;
public class MainActivity extends AppCompatActivity {
private final String TAG = "FCMExample: ";
private String m_FCMtoken;
private TextView tvMsg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// sendNotification("خرید موفقیت آمیز", "از خرید شما سپاس گذاریم");
// TODO: get the FCM instance default token
m_FCMtoken = FirebaseInstanceId.getInstance().getToken();
tvMsg = (TextView) findViewById(R.id.textView2);
// TODO: Log the token to debug output so we can copy it
((Button) findViewById(R.id.btnLogToken)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.i(TAG, "FCm example token : " + m_FCMtoken);
}
});
// TODO: subscribe to a topic
((Button) findViewById(R.id.btnSubscribe)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// FirebaseMessaging.getInstance().subscribeToTopic("test-topic");
sendNotification("title", "message");
}
});
// TODO: unsubscribe from a topic
((Button) findViewById(R.id.btnUnsubscribe)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FirebaseMessaging.getInstance().unsubscribeFromTopic("test-topic");
}
});
// TODO: When the activity starts up, look for intent information
// that may have been passed in from the Notification tap
if (getIntent().getExtras() != null) {
String info = "";
for (String key : getIntent().getExtras().keySet()) {
Object val = getIntent().getExtras().get(key);
info += key + " : " + val + "\n";
}
tvMsg.setText(info);
} else {
tvMsg.setText("No launch information");
}
}
private void sendNotification(String messageTitle, String messageBody) {
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
@SuppressLint("WrongConstant")
NotificationChannel notificationChannel = new NotificationChannel("my_notification", "n_channel", NotificationManager.IMPORTANCE_MAX);
notificationChannel.setDescription("description");
notificationChannel.setName("Channel Name");
assert notificationManager != null;
notificationManager.createNotificationChannel(notificationChannel);
}
// big text notification
NotificationCompat.BigTextStyle bStyle = new NotificationCompat.BigTextStyle()
.bigText("لورم ایپسوم متنی است که ساختگی برای طراحی و چاپ آن مورد است. صنعت چاپ زمانی لازم بود شرایطی شما باید فکر ثبت نام و طراحی، لازمه خروج می باشد ")
.setBigContentTitle("نوتیفیکیشن طولانی")
.setSummaryText("خلاصه متن طولانی");
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification)
.setContentTitle(messageTitle)
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(soundUri)
// .setContentIntent(pendingIntent)
.setDefaults(Notification.DEFAULT_ALL)
.addAction(R.drawable.ic_arow, "Buy", pendingIntent)
.addAction(R.drawable.comment, "Product details", pendingIntent) // set btn notification
.setOnlyAlertOnce(true)
.setChannelId("my_notification")
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.icon))
.setStyle(new NotificationCompat.BigPictureStyle()
.bigPicture(BitmapFactory.decodeResource(getResources(), R.drawable.icon8))) // change big image
.setColor(Color.parseColor("#3F5996"));
//.setProgress(100,50,false);
assert notificationManager != null;
int m = (int) ((new Date().getTime() / 1000L) % Integer.MAX_VALUE);
notificationManager.notify(m, notificationBuilder.build());
}
}
|
package com.example.a12306f.order;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
;
import com.example.a12306f.R;
import com.example.a12306f.ViewPagerActivity;
import com.example.a12306f.a.Order;
import com.example.a12306f.utils.Constant;
import com.example.a12306f.utils.NetworkUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class TicketNeedPayActivity extends AppCompatActivity {
final private String TAG = "TicketNeedPayActivity";
private Order order;
private List<Map<String,Object>> data;
private SimpleAdapter simpleAdapter;
private ProgressDialog progressDialog;
private TextView tvNeedPayId, tvCancelOrder, tvConfirmOrder;
private ListView lv_order_list_need_pay;
@SuppressLint("HandlerLeak")
private Handler handler1 = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (progressDialog != null){
progressDialog.dismiss();
}
switch (msg.what){
case 1:
String result = msg.obj.toString();
if ("1".equals(result)){
Toast.makeText(TicketNeedPayActivity.this,"取消订单成功!",Toast.LENGTH_SHORT).show();
TicketNeedPayActivity.this.finish();
}
break;
}
}
};
@SuppressLint("HandlerLeak")
private Handler handler2 = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (progressDialog != null){
progressDialog.dismiss();
}
switch (msg.what){
case 1:
String result = msg.obj.toString();
if ("1".equals(result)){
Toast.makeText(TicketNeedPayActivity.this,"确认支付成功!",Toast.LENGTH_SHORT).show();
TicketNeedPayActivity.this.finish();
}
break;
}
}
};
// private String[] names = {"冬不拉","陈飞"};
// private String[] lieche = {"D5","D5"};
// private String[] date = {"2020-6-1","2020-6-1"};
// private String[] liechehao = {"6车51号","6车52号"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ticket_need_pay);
tvNeedPayId = findViewById(R.id.ticket_order_id_wait);
tvCancelOrder = findViewById(R.id.cancel_order);
tvConfirmOrder = findViewById(R.id.confirm_order);
lv_order_list_need_pay = findViewById(R.id.lv_ticket_order_need_pay);
order = (Order) getIntent().getSerializableExtra("order");
Log.d(TAG, "order1111:"+order);
tvNeedPayId.setText(order.getId());
data = new ArrayList<>();
for (int i=0 ; i < order.getPassengerList().length; i++){
Map<String,Object> map = new HashMap<>();
map.put("names",order.getPassengerList()[i].getName());
map.put("lieche",order.getTrain().getTrainNo());
map.put("date",order.getTrain().getStartTrainDate());
map.put("liechehao","5车"+(i+1)+"号");
// map.put("liechehao",order.getPassengerList()[i].getSeat().getSeatNO());
data.add(map);
}
simpleAdapter = new SimpleAdapter(TicketNeedPayActivity.this,
data,
R.layout.item_yuding04,
new String[]{"names","lieche","date","liechehao"},
new int[]{R.id.textView_name_YD04,R.id.textView_lieche_YD04,R.id.textView_date_YD04,R.id.textView_liechehao_YD04});
lv_order_list_need_pay.setAdapter(simpleAdapter);
//点击取消订单
tvCancelOrder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!NetworkUtils.checkNet(TicketNeedPayActivity.this)){
Toast.makeText(TicketNeedPayActivity.this,"当前网络不可用",Toast.LENGTH_SHORT).show();
return;
}
progressDialog = ProgressDialog.show(TicketNeedPayActivity.this,
null,
"正在加载中....",
false,true);
new Thread(){
@Override
public void run() {
super.run();
Message message = handler1.obtainMessage();
SharedPreferences sharedPreferences = getSharedPreferences("user", Context.MODE_PRIVATE);
String sessionid = sharedPreferences.getString("Cookie", "");
Log.d(TAG, "sessionid: " + sessionid);
try {
OkHttpClient okHttpClient = new OkHttpClient();
RequestBody requestBody = new FormBody.Builder()
.add("orderId",order.getId())
.build();
Request request = new Request.Builder()
.url(Constant.Host +"/otn/Cancel")
.addHeader("Cookie", sessionid)
.post(requestBody)
.build();
Response response = okHttpClient.newCall(request).execute();
String responseData = response.body().string();
Log.d(TAG, "获取的服务器数据: " + responseData);
if (response.isSuccessful()) {
//解析JSON
Gson gson = new GsonBuilder().create();
//Order orders = gson.fromJson(result,Order.class);
String result = gson.fromJson(responseData,String.class);
message.what = 1;
message.obj = result;
} else {
message.what = 2;
}
}
catch (IOException e) {
e.printStackTrace();
message.what = 2;
}
catch (JsonSyntaxException e) {
e.printStackTrace();
message.what = 3;
}
handler1.sendMessage(message);
}
}.start();
}
});
//确认支付
tvConfirmOrder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!NetworkUtils.checkNet(TicketNeedPayActivity.this)){
Toast.makeText(TicketNeedPayActivity.this,"当前网络不可用",Toast.LENGTH_SHORT).show();
return;
}
progressDialog = ProgressDialog.show(TicketNeedPayActivity.this,
null,
"正在加载中....",
false,true);
new Thread(){
@Override
public void run() {
super.run();
Message message = handler2.obtainMessage();
SharedPreferences sharedPreferences = getSharedPreferences("user", Context.MODE_PRIVATE);
String sessionid = sharedPreferences.getString("Cookie", "");
Log.d(TAG, "sessionid: " + sessionid);
try {
OkHttpClient okHttpClient = new OkHttpClient();
RequestBody requestBody = new FormBody.Builder()
.add("orderId",order.getId())
.build();
Request request = new Request.Builder()
.url(Constant.Host +"/otn/Pay")
.addHeader("Cookie", sessionid)
.post(requestBody)
.build();
Response response = okHttpClient.newCall(request).execute();
String responseData = response.body().string();
Log.d(TAG, "获取的服务器数据: " + responseData);
if (response.isSuccessful()) {
//解析JSON
Gson gson = new GsonBuilder().create();
//Order orders = gson.fromJson(result,Order.class);
String result1 = gson.fromJson(responseData,String.class);
message.what = 1;
message.obj = result1;
} else {
message.what = 2;
}
}
catch (IOException e) {
e.printStackTrace();
message.what = 2;
}
catch (JsonSyntaxException e) {
e.printStackTrace();
message.what = 3;
}
handler2.sendMessage(message);
}
}.start();
}
});
}
}
|
import java.util.Scanner;
import java.lang.String;
public class Blackjack {
public static void main(String[] args) {
P1Random rng = new P1Random();
Scanner reader = new Scanner(System.in);
int count = 1, play = 3, wincount = 0, losecount = 0, tiecount = 0, hand = 0, dealerhand = 0, card = 0, cardval = 0, statgame = 0, n = 1;
String avg;
while (true) {
System.out.println("START GAME #" + count); //Game Counter
System.out.println(""); //Game Counter
card = rng.nextInt(13) + 1; //Get card value
// System.out.println(card); // for debug shows card value
if (card == 1) {
System.out.println("Your card is a ACE!");
cardval = 1;
} else if (card == 13) {
System.out.println("Your card is a KING!");
cardval = 10;
} else if (card == 12) {
System.out.println("Your card is a QUEEN!");
cardval = 10;
} else if (card == 11) {
System.out.println("Your card is a JACK!");
cardval = 10;
} else if (card == 2 | card == 3 | card == 4 | card == 5 | card == 6 | card == 7 | card == 8 | card == 9 | card == 10) {
System.out.println("Your card is a " + card + "!");
cardval = card;
}
hand += cardval; //Add card value to hand
System.out.println("Your hand is: " + hand);
if (hand == 21) {
System.out.println("BLACKJACK! You Win!");
play = 1;
hand = 0;
break;
} else if (hand > 21) {
System.out.println("You exceeded 21! You Lose.");
hand = 0;
play = 0;
break;
}
while (true) {
//Prints menu
System.out.println("");
System.out.println("1. Get another card");
System.out.println("2. Hold hand");
System.out.println("3. Print statistics");
System.out.println("4. Exit");
System.out.println("");
System.out.print("Choose an option: ");
n = reader.nextInt();
System.out.println("");
if (n == 1) {
card = rng.nextInt(13) + 1; //Get card value
// System.out.println(card); // for debug shows card value
if (card == 1) {
System.out.println("Your card is a ACE!");
cardval = 1;
} else if (card == 13) {
System.out.println("Your card is a KING!");
cardval = 10;
} else if (card == 12) {
System.out.println("Your card is a QUEEN!");
cardval = 10;
} else if (card == 11) {
System.out.println("Your card is a JACK!");
cardval = 10;
} else if (card == 2 | card == 3 | card == 4 | card == 5 | card == 6 | card == 7 | card == 8 | card == 9 | card == 10) {
System.out.println("Your card is a " + card + "!");
cardval = card;
}
hand += cardval; //Add card value to hand
System.out.println("Your hand is: " + hand);
if (hand == 21) {
System.out.println("");
System.out.println("BLACKJACK! You win!");
System.out.println("");
play = 1;
hand = 0;
break;
} else if (hand > 21) {
System.out.println("");
System.out.println("You exceeded 21! You lose.");
System.out.println("");
hand = 0;
play = 0;
break;
}
}
if (n == 2) {
dealerhand = rng.nextInt(11) + 16;
System.out.println("Dealer's hand: "+ dealerhand);
System.out.println("Your hand is: "+ hand);
if (dealerhand == hand) {
System.out.println("");
System.out.println("It's a tie! No one wins!");
System.out.println("");
play = 2;
hand = 0;
break;
}
else if (dealerhand > 21) {
System.out.println("");
System.out.println("You win!");
System.out.println("");
play = 1;
hand = 0;
break;
} else if (dealerhand > hand) {
System.out.println("");
System.out.println("Dealer wins!");
System.out.println("");
play = 0;
hand = 0;
break;
} else if (hand > dealerhand) {
System.out.println("You Win!");
play = 1;
hand = 0;
break;
}
}
if (n == 3) {
statgame = count - 1; // need this so stats dont count current game
System.out.println("Number of Player wins: " + wincount);
System.out.println("Number of Dealer wins: " + losecount);
System.out.println("Number of tie games: " + tiecount);
System.out.println("Total # of games played is: " + statgame); //statgame is total finished games
avg = String.format("%.1f", (float) wincount / (float) (statgame) * 100);
System.out.println("Percentage of Player wins: " + avg + "%");
}
if (n == 4) {
reader.close();
return;
} else if (n > 4) {
System.out.println("Invalid input!");
System.out.println("Please enter an integer value between 1 and 4.");
}
}
if (play == 1) { //Tracks wins and losses
wincount++;
} else if (play == 0)
losecount++;
else {
tiecount++;
}
count = count + 1; //increment game counter
}
}
}
|
package compilador.gerador.codigo;
public class BufferCodigo<T> extends Buffer<T> {
public BufferCodigo() {
super();
}
} |
package com.tencent.mm.plugin.appbrand.jsapi.video;
import com.tencent.mm.plugin.appbrand.jsapi.video.f.b;
import com.tencent.mm.plugin.appbrand.s.i;
import com.tencent.mm.plugin.appbrand.s.j;
import com.tencent.mm.sdk.platformtools.x;
class AppBrandVideoView$5 implements b {
final /* synthetic */ AppBrandVideoView gaM;
AppBrandVideoView$5(AppBrandVideoView appBrandVideoView) {
this.gaM = appBrandVideoView;
}
public final void ajJ() {
x.d("MicroMsg.AppBrandVideoView", "onSingleTap");
if (AppBrandVideoView.f(this.gaM)) {
AppBrandVideoView.g(this.gaM).ajS();
}
}
public final void ajK() {
x.d("MicroMsg.AppBrandVideoView", "onDoubleTap");
}
public final void ajL() {
if (AppBrandVideoView.h(this.gaM)) {
AppBrandVideoView.i(this.gaM).setVisibility(0);
}
}
public final int e(int i, float f) {
int i2 = 0;
if (AppBrandVideoView.h(this.gaM)) {
x.i("MicroMsg.AppBrandVideoView", "onDragProgress:" + i + "/" + f);
float measuredWidth = f / ((float) this.gaM.getMeasuredWidth());
int videoDurationSec = AppBrandVideoView.b(this.gaM).getVideoDurationSec();
int currentPosition = ((int) (measuredWidth * ((float) videoDurationSec))) + getCurrentPosition();
if (currentPosition >= 0) {
if (currentPosition > videoDurationSec) {
i2 = videoDurationSec;
} else {
i2 = currentPosition;
}
}
AppBrandVideoView.i(this.gaM).setText(g.bx(((long) i2) * 1000) + "/" + g.bx(((long) videoDurationSec) * 1000));
}
return i2;
}
public final void f(int i, float f) {
AppBrandVideoView.i(this.gaM).setVisibility(8);
int currPosSec = AppBrandVideoView.b(this.gaM).getCurrPosSec();
x.i("MicroMsg.AppBrandVideoView", "onEndDragProgress: dragPosition=%d currentPositon=%d totalDistanceX=%s", new Object[]{Integer.valueOf(i), Integer.valueOf(currPosSec), Float.valueOf(f)});
if (AppBrandVideoView.h(this.gaM)) {
this.gaM.C(i, false);
}
}
public final int getCurrentPosition() {
return AppBrandVideoView.b(this.gaM).getCurrPosSec();
}
public final void aa(float f) {
x.d("MicroMsg.AppBrandVideoView", "onAdjustVolume:" + f);
AppBrandVideoView.j(this.gaM).setPercent(f);
AppBrandVideoView.k(this.gaM).setText(j.app_brand_video_volume);
AppBrandVideoView.l(this.gaM).setImageResource(i.app_brand_video_volume_icon);
AppBrandVideoView.m(this.gaM).setVisibility(0);
}
public final void ab(float f) {
x.d("MicroMsg.AppBrandVideoView", "onAdjustBrightness:" + f);
AppBrandVideoView.j(this.gaM).setPercent(f);
AppBrandVideoView.k(this.gaM).setText(j.app_brand_video_brightness);
AppBrandVideoView.l(this.gaM).setImageResource(i.app_brand_video_brightness_icon);
AppBrandVideoView.m(this.gaM).setVisibility(0);
}
public final void ajM() {
AppBrandVideoView.m(this.gaM).setVisibility(8);
}
public final void ajN() {
AppBrandVideoView.m(this.gaM).setVisibility(8);
}
}
|
package com.huawei.esdk.csdemo.listener;
import java.awt.Rectangle;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.util.Vector;
import com.huawei.esdk.csdemo.action.ScheduleConfAction;
import com.huawei.esdk.csdemo.adapter.MouseAdapter;
import com.huawei.esdk.csdemo.common.LabelText;
import com.huawei.esdk.csdemo.common.MethodThread;
import com.huawei.esdk.csdemo.memorydb.DataBase;
import com.huawei.esdk.csdemo.view.DemoApp;
import com.huawei.esdk.csdemo.view.RecurrenceConfFrame;
import com.huawei.esdk.csdemo.view.ScheduleConfFrame;
import com.huawei.esdk.csdemo.view.SelectSiteFrame;
public class ScheduleConfListener
{
private ScheduleConfFrame scheduleConfFrame;
private ScheduleConfAction scheduleConfAction;
public void register(ScheduleConfFrame scheduleConfFrame)
{
this.scheduleConfFrame = scheduleConfFrame;
this.scheduleConfAction = new ScheduleConfAction(scheduleConfFrame);
addShowSiteListListener();
addCloseListener();
addCreateConfListener();
addRecurrenceConfDetailListener();
addAnonymitySiteListener();
addDeleteBtnListener();
addRecurrenceFlagListener();
}
@SuppressWarnings("unchecked")
private void addShowSiteListListener()
{
scheduleConfFrame.getAddsiteBut1().addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
if (null == scheduleConfFrame.getFrame())
{
Rectangle rect = new Rectangle(350, 250, 600, 310);
SelectSiteFrame frame = new SelectSiteFrame(rect,
scheduleConfFrame, true);
frame.lunchFrame();
scheduleConfFrame.setFrame(frame);
}
Vector<Vector<String>> existData = scheduleConfFrame.getTableMode().getDataVector();
Vector<Vector<String>> vector = new Vector<Vector<String>>();
for (Vector<String> data : DataBase.getInstance().getSelectSiteListVector())
{
boolean flag = false;
for (Vector<String> exist : existData)
{
if (data.get(0).equals(exist.get(0)))
{
flag = true;
break;
}
}
if (flag)
{
continue;
}
else
{
vector.add(data);
}
}
scheduleConfFrame.getFrame().getSiteControlSiteListPan().freshTable(vector);
scheduleConfFrame.getFrame().setVisible(true);
}
});
}
private void addCloseListener()
{
scheduleConfFrame.getCloseBut().addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
scheduleConfFrame.dispose();
}
});
}
private void addCreateConfListener()
{
scheduleConfFrame.getScheConfBut().addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
String duration = scheduleConfFrame.getConfHowLongText()
.getText();
if (!duration.matches("\\d+"))
{
DemoApp.mainFrame
.getPan1()
.getBottom_show_result_panel()
.showResultMsg(
false,
LabelText.duration_error[DataBase.getInstance().getLanguageFlag()]);
return;
}
// Integer result = scheduleConfAction.scheduleConf();
new MethodThread(scheduleConfAction,"scheduleConf").start();
//modify by gaolinfei
// if (0 != result)
// {
// DemoApp.mainFrame
// .getPan1()
// .getBottom_show_result_panel()
// .showResultMsg(
// false,
// LabelText.schedule_conf_failure[DataBase.getInstance().getLanguageFlag()]
// + result);
// return;
// }
// else
// {
// DemoApp.mainFrame
// .getPan1()
// .getBottom_show_result_panel()
// .showResultMsg(
// true,
// LabelText.schedule_conf_success[DataBase.getInstance().getLanguageFlag()]);
//
// DemoApp.mainFrame.getPan1().getConfListPanel()
// .refreshTable();
// scheduleConfFrame.getConfIdText().setText("");
// scheduleConfFrame.getConfNameText().setText("");
// scheduleConfFrame.getConfBeginTimeText().setText("");
// scheduleConfFrame.getConfHowLongText().setText("");
// scheduleConfFrame.dispose();
// return;
// }
}
});
}
private void addRecurrenceConfDetailListener()
{
scheduleConfFrame.getRecurrenceDetailBut().addMouseListener(
new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
if (null == scheduleConfFrame.getRecurrenceConfDetail())
{
Rectangle rect = new Rectangle(300, 200, 350, 400);
RecurrenceConfFrame recurrenceConfFrame = new RecurrenceConfFrame(
scheduleConfFrame, true, rect);
recurrenceConfFrame.lunchFrame();
scheduleConfFrame
.setRecurrenceConfDetail(recurrenceConfFrame);
recurrenceConfFrame.setVisible(true);
}
else
{
scheduleConfFrame.getRecurrenceConfDetail()
.setVisible(true);
}
}
});
}
private void addAnonymitySiteListener()
{
scheduleConfFrame.getAddsiteBut().addMouseListener(new MouseAdapter()
{
@Override
@SuppressWarnings("unchecked")
public void mouseClicked(MouseEvent e)
{
Vector<Vector<String>> data = scheduleConfFrame.getTableMode()
.getDataVector();
Vector<String> vector = new Vector<String>();
vector.add(LabelText.schedule_conf_anonymous_site[DataBase.
getInstance().getLanguageFlag()]);
vector.add("");
vector.add("");
vector.add("");
vector.add("");
vector.add("");
vector.add("");
vector.add("");
data.add(vector);
scheduleConfFrame.clearTable();
scheduleConfFrame.refreshSitesList(data);
}
});
}
@SuppressWarnings("unchecked")
private void addDeleteBtnListener()
{
scheduleConfFrame.getDeletesiteBut().addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
int[] rows = scheduleConfFrame.getJtable().getSelectedRows();
if (0 == rows.length)
{
DemoApp.mainFrame.getPan1()
.getBottom_show_result_panel()
.showResultMsg(
false,
LabelText.choose_sites[DataBase.getInstance().getLanguageFlag()]);
return;
}
Vector<Vector<String>> selectedSites = scheduleConfFrame.getTableMode().getDataVector();
for (int i = rows.length - 1 ;i >= 0;i--)
{
selectedSites.removeElementAt(rows[i]);
}
scheduleConfFrame.clearTable();
scheduleConfFrame.refreshSitesList(selectedSites);
}
});
}
private void addRecurrenceFlagListener()
{
scheduleConfFrame.getRecurrenceFlag().addItemListener(new ItemListener()
{
@Override
public void itemStateChanged(ItemEvent e)
{
if (scheduleConfFrame.getRecurrenceFlag().isSelected() == true)
{
scheduleConfFrame.getRecurrenceDetailBut().setVisible(true);
}
else
{
scheduleConfFrame.getRecurrenceDetailBut().setVisible(false);
}
}
});
}
}
|
package com.tencent.mm.bs;
import java.util.concurrent.atomic.AtomicInteger;
public final class c {
public static abstract class b<Out, In1, In2> extends a<Out> implements com.tencent.mm.bs.b.a<In1> {
com.tencent.mm.bs.b.b<In1> sNF;
private com.tencent.mm.bs.b.b<In2> sNG;
private com.tencent.mm.bs.b.a<In2> sNH = new com.tencent.mm.bs.b.a<In2>() {
public final void aZ(In2 in2) {
b.this.set(b.this.u(b.this.sNF.get(), in2));
}
};
private final AtomicInteger sNI = new AtomicInteger(0);
protected abstract Out u(In1 in1, In2 in2);
protected b(String str, com.tencent.mm.bs.b.b<In1> bVar, com.tencent.mm.bs.b.b<In2> bVar2, Out out) {
super(str, out);
this.sNF = bVar;
this.sNG = bVar2;
}
protected final void c(com.tencent.mm.bs.b.a<Out> aVar) {
super.c(aVar);
if (this.sNI.getAndIncrement() == 0) {
this.sNF.a(this);
this.sNG.a(this.sNH);
}
}
protected final void d(com.tencent.mm.bs.b.a<Out> aVar) {
super.b(aVar);
if (this.sNI.decrementAndGet() == 0) {
this.sNF.b(this);
this.sNG.b(this.sNH);
}
}
public final void aZ(In1 in1) {
set(u(in1, this.sNG.get()));
}
}
public static abstract class d<Out, In> extends a<Out> implements com.tencent.mm.bs.b.a<In> {
private final AtomicInteger sNI = new AtomicInteger(0);
private com.tencent.mm.bs.b.b<In> sNK;
protected abstract Out cj(In in);
protected d(String str, com.tencent.mm.bs.b.b<In> bVar, Out out) {
super(str, out);
this.sNK = bVar;
}
protected final void c(com.tencent.mm.bs.b.a<Out> aVar) {
super.c(aVar);
if (this.sNI.getAndIncrement() == 0) {
this.sNK.a(this);
}
}
protected final void d(com.tencent.mm.bs.b.a<Out> aVar) {
super.d(aVar);
if (this.sNI.decrementAndGet() == 0) {
this.sNK.b(this);
}
}
public final void aZ(In in) {
set(cj(in));
}
}
private static class a extends b<Boolean, Boolean, Boolean> {
protected final /* synthetic */ Object u(Object obj, Object obj2) {
boolean z = ((Boolean) obj).booleanValue() && ((Boolean) obj2).booleanValue();
return Boolean.valueOf(z);
}
public a(com.tencent.mm.bs.b.b<Boolean> bVar, com.tencent.mm.bs.b.b<Boolean> bVar2) {
String str = bVar.name() + " && " + bVar2.name();
boolean z = ((Boolean) bVar.get()).booleanValue() && ((Boolean) bVar2.get()).booleanValue();
super(str, bVar, bVar2, Boolean.valueOf(z));
}
}
private static class c extends d<Boolean, Boolean> {
protected final /* synthetic */ Object cj(Object obj) {
return Boolean.valueOf(!((Boolean) obj).booleanValue());
}
public c(com.tencent.mm.bs.b.b<Boolean> bVar) {
super("!" + bVar.name(), bVar, Boolean.valueOf(!((Boolean) bVar.get()).booleanValue()));
}
}
}
|
package com.debtrepaymentapp.dao;
import java.util.List;
import com.debtrepaymentapp.model.Debt;
import com.debtrepaymentapp.model.User;
public interface DebtDAO {
public void saveOrUpdate(Debt debt,Integer userID);
public void delete(int userID, String debtName);
public Debt get(int userID, String debtName);
public List<Debt> list(int userID);
public void createUser(User user);
}
|
package collection.lists.secondTask;
import java.util.List;
public class Processor {
private final List<String> companies;
private static final String SEPARATOR = ", ";
public Processor(List<String> companies) {
this.companies = companies;
}
public void runProcces() {
StringBuilder buldier = new StringBuilder();
for (int i = 0; i < companies.size(); i++) {
if (i == companies.size() - 1 ){
buldier.append(companies.get(i));
} else {
buldier.append(companies.get(i)).append(SEPARATOR);
}
}
System.out.println(buldier.toString());
}
}
|
package org.sbbs.demo.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.sbbs.base.model.BaseObject;
@Entity
@Table( name = "t_demo_entity" )
@Cache( usage = CacheConcurrencyStrategy.READ_WRITE )
public class DemoEntity
extends BaseObject {
/**
*
*/
private static final long serialVersionUID = 5295152954297131636L;
@Id
@GeneratedValue( strategy = GenerationType.AUTO )
private Long demoId;
/**
*/
@Column( name = "intField", nullable = false )
private int intField;
@Column( name = "longField", nullable = false )
private long longField;
private short shortField;
private byte byteField;
private boolean booleanField;
private char charField;
private float floatField;
private double doubleField;
/**
*/
private Integer intObjField;
private Long longObjField;
private Short shortObjField;
private Byte byteObjField;
private Boolean booleanObjField;
private Character charObjField;
private Float floatObjField;
private Double doubleObjField;
/**
*/
private Date dateField;
private String stringField;
private BigDecimal bigDecimalField;
private Timestamp timestampField = new Timestamp( System.currentTimeMillis() );
/*
* private Calendar calendarField; private Locale localeField; private TimeZone timeZoneField; private Currency
* currencyField;
*/
/**
*/
public Long getDemoId() {
return demoId;
}
/**
*/
public void setDemoId( Long demoId ) {
this.demoId = demoId;
}
@Column( name = "bigDecimalField" )
public BigDecimal getBigDecimalField() {
return this.bigDecimalField;
}
public void setBigDecimalField( BigDecimal bigDecimalField ) {
this.bigDecimalField = bigDecimalField;
}
@Column( name = "booleanField", nullable = false )
public boolean isBooleanField() {
return this.booleanField;
}
public void setBooleanField( boolean booleanField ) {
this.booleanField = booleanField;
}
@Column( name = "booleanObjField", nullable = false )
public Boolean getBooleanObjField() {
return this.booleanObjField;
}
public void setBooleanObjField( Boolean booleanObjField ) {
this.booleanObjField = booleanObjField;
}
@Column( name = "byteField", nullable = false )
public byte getByteField() {
return this.byteField;
}
public void setByteField( byte byteField ) {
this.byteField = byteField;
}
@Column( name = "byteObjField", nullable = false )
public Byte getByteObjField() {
return this.byteObjField;
}
public void setByteObjField( Byte byteObjField ) {
this.byteObjField = byteObjField;
}
@Column( name = "charField", nullable = false, length = 1 )
public char getCharField() {
return this.charField;
}
public void setCharField( char charField ) {
this.charField = charField;
}
@Column( name = "charObjField", length = 1, nullable = false )
public Character getCharObjField() {
return this.charObjField;
}
public void setCharObjField( Character charObjField ) {
this.charObjField = charObjField;
}
@Temporal( TemporalType.DATE )
@Column( name = "dateField", length = 19, nullable = false )
public Date getDateField() {
return this.dateField;
}
public void setDateField( Date dateField ) {
this.dateField = dateField;
}
@Column( name = "doubleField", nullable = false, precision = 22, scale = 0 )
public double getDoubleField() {
return this.doubleField;
}
public void setDoubleField( double doubleField ) {
this.doubleField = doubleField;
}
@Column( name = "doubleObjField", precision = 22, scale = 0, nullable = false )
public Double getDoubleObjField() {
return this.doubleObjField;
}
public void setDoubleObjField( Double doubleObjField ) {
this.doubleObjField = doubleObjField;
}
@Column( name = "floatField", nullable = false, precision = 12, scale = 0 )
public float getFloatField() {
return this.floatField;
}
public void setFloatField( float floatField ) {
this.floatField = floatField;
}
@Column( name = "floatObjField", precision = 12, scale = 0, nullable = false )
public Float getFloatObjField() {
return this.floatObjField;
}
public void setFloatObjField( Float floatObjField ) {
this.floatObjField = floatObjField;
}
@Max( 100 )
@Min( 0 )
public int getIntField() {
return this.intField;
}
public void setIntField( int intField ) {
this.intField = intField;
}
@Column( name = "intObjField" )
public Integer getIntObjField() {
return this.intObjField;
}
public void setIntObjField( Integer intObjField ) {
this.intObjField = intObjField;
}
public Long getLongField() {
return this.longField;
}
public void setLongField( Long longField ) {
this.longField = longField;
}
@Column( name = "longObjField" )
public Long getLongObjField() {
return this.longObjField;
}
public void setLongObjField( Long longObjField ) {
this.longObjField = longObjField;
}
@Column( name = "shortField", nullable = false )
public short getShortField() {
return this.shortField;
}
public void setShortField( short shortField ) {
this.shortField = shortField;
}
@Column( name = "shortObjField" )
public Short getShortObjField() {
return this.shortObjField;
}
public void setShortObjField( Short shortObjField ) {
this.shortObjField = shortObjField;
}
@NotNull
@Size( min = 2, max = 500, message = "size must be between {min} and {max}" )
@Column( name = "stringField", length = 50, nullable = false )
public String getStringField() {
return this.stringField;
}
public void setStringField( String stringField ) {
this.stringField = stringField;
}
@Temporal( TemporalType.TIMESTAMP )
@Column( name = "timestampField", length = 19, nullable = false )
public Timestamp getTimestampField() {
return this.timestampField;
}
public void setTimestampField( Timestamp timestampField ) {
this.timestampField = timestampField;
}
@Override
public String toString() {
return "DemoEntity [demoId=" + demoId + ", intField=" + intField + ", longField=" + longField + ", shortField=" + shortField + ", byteField="
+ byteField + ", booleanField=" + booleanField + ", charField=" + charField + ", floatField=" + floatField + ", doubleField="
+ doubleField + ", intObjField=" + intObjField + ", longObjField=" + longObjField + ", shortObjField=" + shortObjField
+ ", byteObjField=" + byteObjField + ", booleanObjField=" + booleanObjField + ", charObjField=" + charObjField + ", floatObjField="
+ floatObjField + ", doubleObjField=" + doubleObjField + ", dateField=" + dateField + ", stringField=" + stringField
+ ", bigDecimalField=" + bigDecimalField + ", timestampField=" + timestampField + "]";
}
@Override
public boolean equals( Object obj ) {
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
DemoEntity other = (DemoEntity) obj;
if ( bigDecimalField == null ) {
if ( other.bigDecimalField != null )
return false;
}
else if ( !bigDecimalField.equals( other.bigDecimalField ) )
return false;
if ( booleanField != other.booleanField )
return false;
if ( booleanObjField == null ) {
if ( other.booleanObjField != null )
return false;
}
else if ( !booleanObjField.equals( other.booleanObjField ) )
return false;
if ( byteField != other.byteField )
return false;
if ( byteObjField == null ) {
if ( other.byteObjField != null )
return false;
}
else if ( !byteObjField.equals( other.byteObjField ) )
return false;
if ( charField != other.charField )
return false;
if ( charObjField == null ) {
if ( other.charObjField != null )
return false;
}
else if ( !charObjField.equals( other.charObjField ) )
return false;
if ( dateField == null ) {
if ( other.dateField != null )
return false;
}
else if ( !dateField.equals( other.dateField ) )
return false;
if ( demoId == null ) {
if ( other.demoId != null )
return false;
}
else if ( !demoId.equals( other.demoId ) )
return false;
if ( Double.doubleToLongBits( doubleField ) != Double.doubleToLongBits( other.doubleField ) )
return false;
if ( doubleObjField == null ) {
if ( other.doubleObjField != null )
return false;
}
else if ( !doubleObjField.equals( other.doubleObjField ) )
return false;
if ( Float.floatToIntBits( floatField ) != Float.floatToIntBits( other.floatField ) )
return false;
if ( floatObjField == null ) {
if ( other.floatObjField != null )
return false;
}
else if ( !floatObjField.equals( other.floatObjField ) )
return false;
if ( intField != other.intField )
return false;
if ( intObjField == null ) {
if ( other.intObjField != null )
return false;
}
else if ( !intObjField.equals( other.intObjField ) )
return false;
if ( longField != other.longField )
return false;
if ( longObjField == null ) {
if ( other.longObjField != null )
return false;
}
else if ( !longObjField.equals( other.longObjField ) )
return false;
if ( shortField != other.shortField )
return false;
if ( shortObjField == null ) {
if ( other.shortObjField != null )
return false;
}
else if ( !shortObjField.equals( other.shortObjField ) )
return false;
if ( stringField == null ) {
if ( other.stringField != null )
return false;
}
else if ( !stringField.equals( other.stringField ) )
return false;
if ( timestampField == null ) {
if ( other.timestampField != null )
return false;
}
else if ( !timestampField.equals( other.timestampField ) )
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ( ( bigDecimalField == null ) ? 0 : bigDecimalField.hashCode() );
result = prime * result + ( booleanField ? 1231 : 1237 );
result = prime * result + ( ( booleanObjField == null ) ? 0 : booleanObjField.hashCode() );
result = prime * result + byteField;
result = prime * result + ( ( byteObjField == null ) ? 0 : byteObjField.hashCode() );
result = prime * result + charField;
result = prime * result + ( ( charObjField == null ) ? 0 : charObjField.hashCode() );
result = prime * result + ( ( dateField == null ) ? 0 : dateField.hashCode() );
result = prime * result + ( ( demoId == null ) ? 0 : demoId.hashCode() );
long temp;
temp = Double.doubleToLongBits( doubleField );
result = prime * result + (int) ( temp ^ ( temp >>> 32 ) );
result = prime * result + ( ( doubleObjField == null ) ? 0 : doubleObjField.hashCode() );
result = prime * result + Float.floatToIntBits( floatField );
result = prime * result + ( ( floatObjField == null ) ? 0 : floatObjField.hashCode() );
result = prime * result + intField;
result = prime * result + ( ( intObjField == null ) ? 0 : intObjField.hashCode() );
result = prime * result + (int) ( longField ^ ( longField >>> 32 ) );
result = prime * result + ( ( longObjField == null ) ? 0 : longObjField.hashCode() );
result = prime * result + shortField;
result = prime * result + ( ( shortObjField == null ) ? 0 : shortObjField.hashCode() );
result = prime * result + ( ( stringField == null ) ? 0 : stringField.hashCode() );
result = prime * result + ( ( timestampField == null ) ? 0 : timestampField.hashCode() );
return result;
}
}
|
package com.mundo.web.interceptor;
import com.mundo.core.util.CollectionUtil;
import com.mundo.web.annotation.CheckCsrf;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Objects;
import java.util.Queue;
/**
* CheckCsrfInterceptor
*
* @author maodh
* @since 2017/8/2
*/
public class CheckCsrfInterceptor extends AnnotationInterceptor<CheckCsrf> {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
boolean isGetMethod = Objects.equals(HttpMethod.GET.name(), request.getMethod());
if (isGetMethod) {
return true;
} else {
// TODO 校验自定义 HTTP Header
Queue<CheckCsrf> annotationQueue = super.getMethodAnnotationQueue(handler, CheckCsrf.class);
boolean isCheck = CollectionUtil.isNotEmpty(annotationQueue) && this.processAnnotationQueue(annotationQueue);
return !isCheck || check(request, response);
}
}
@Override
boolean processAnnotationQueue(Queue<CheckCsrf> queue) {
CheckCsrf checkCsrf;
while ((checkCsrf = queue.poll()) != null) {
if (!checkCsrf.value()) {
return false;
}
}
return true;
}
private boolean check(HttpServletRequest request, HttpServletResponse response) throws IOException {
String referer = request.getHeader(HttpHeaders.REFERER);
String host = request.getHeader(HttpHeaders.HOST);
return Objects.equals(referer, host);
}
}
|
package com.example.obat9;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class RPkulit extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_rpkulit);
}
public void RAlergi(View view) {
Intent intent = new Intent(RPkulit.this, RPKalergi.class);
startActivity(intent);
}
public void RBisul(View view) {
Intent intent = new Intent(RPkulit.this, RPKbisul.class);
startActivity(intent);
}
public void RCacar_Air(View view) {
Intent intent = new Intent(RPkulit.this, RPKcacarair.class);
startActivity(intent);
}
public void RCampak(View view) {
Intent intent = new Intent(RPkulit.this, RPKcampak.class);
startActivity(intent);
}
public void RKoreng(View view) {
Intent intent = new Intent(RPkulit.this, RPKkoreng.class);
startActivity(intent);
}
public void RKurap(View view) {
Intent intent = new Intent(RPkulit.this, RPKkurap.class);
startActivity(intent);
}
public void RKutil(View view) {
Intent intent = new Intent(RPkulit.this, RPKkutil.class);
startActivity(intent);
}
public void RKusta(View view) {
Intent intent = new Intent(RPkulit.this, RPKkusta.class);
startActivity(intent);
}
public void RLuka_Bakar(View view) {
Intent intent = new Intent(RPkulit.this, RPKlukabakar.class);
startActivity(intent);
}
public void RPanu(View view) {
Intent intent = new Intent(RPkulit.this, RPKpanu.class);
startActivity(intent);
}
}
|
package controller.constants;
/**Some messages to log which duplicated with error messages
* */
public interface LogMessages {
/*AbstractGenericService methods*/
String INCORRECT_INPUT_DATA = "Incorrect input data";
String GETTING_ELEMENT_BY_ID = "Try to get element by id";
String UPDATING_ELEMENT = "Updating element";
String INSERTING_ELEMENT = "Inserting element";
String DELETING_ELEMENT = "Deleting element";
String GETTING_ELEMENTS_AMOUNT = "Getting elements amount";
String GETTING_PAGINATED_LIST = "Getting paginated list";
String CAN_NOT_GET_ELEMENT_BY_ID = "Couldn't get element by id";
String CAN_NOT_UPDATE_ELEMENT = "Couldn't update element";
String CAN_NOT_INSERT_ELEMENT = "Couldn't insert element";
String CAN_NOT_DELETE_ELEMENT = "Couldn't delete element";
String CAN_NOT_GET_ELEMENTS_AMOUNT = "Couldn't get elements amount.";
String CAN_NOT_GET_PAGINATED_LIST = "Couldn't get paginated list.";
/*AdminServiceImpl methods*/
String GETTING_ADMIN_BY_USER_ID = "Try to get admin info by user id";
String CAN_NOT_GET_ADMIN_BY_USER_ID = "Couldn't get admin info";
/*BusServiceImpl methods*/
String GET_FREE_BUSES = "Getting fre buses";
String CAN_NOT_GET_FREE_BUSES = "Couldn't get free buses";
}
|
import java.util.Locale;
public class Main {
public static void main(String[] args) {
// Imprimindo um texto qualquer na tela
System.out.print("Olá Mundo!"); //print não faz quebra de linha
System.out.println("Bom dia!"); //println faz a quebra
System.out.print("Tudo Bem!");
//Imprimir conteudo de alguma variável de tipo básico
int y = 32;
System.out.println(y);
//Imprimir o conteúdo de uma variável com ponto flutuante
double x = 10.35784;
System.out.println(x);
//Imprimir definindo a formatação de casa decimais
System.out.printf("%.2f%n", x); //Em "%.2f" define-se a qtd de casas decimais, "/n" ou "%n" faz a quebra de linha/ tbm fez arredondamento
System.out.printf("%.4f%n", x); //Com 4 casas decimais - usa a virgula pois pega a formatação do computador o qual está sendo usado
//A lingua portuguesa usa como separador de decimais a virgula - Para mudar e usar o separador de decimais dos USA Usamos:
Locale.setDefault(Locale.US);
System.out.printf("%.4f%n", x);
//Concatenar
System.out.println("Resultado = "+ x + " metros");
//Concatenar - usando o printf
System.out.printf("Resultado = %.2f metros%n", x); //%n faz a quebra de linha
//Concatenar - usando o printf - print com formatacao
//Varios elementos de tipos diferentes
//%f = ponto flutuante - %d = inteiro - %s = texto %n = quebra de linha
String nome = "Maria";
int idade = 31;
double renda = 4000.0;
System.out.printf("%s tem %d anos ganha R$ %.2f reais%n", nome, idade, renda);
}
}
|
package controller;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import model.ReceiverLookupDocument;
import model.SerializedMail;
import model.StatusMessageObject;
import net.spy.memcached.internal.OperationFuture;
import com.carrotsearch.hppc.IntObjectOpenHashMap;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.couchbase.client.CouchbaseClient;
class MailControllerQueueThread extends Thread
{
private final static int RETRY_DELAY = 50;
private final AtomicBoolean running = new AtomicBoolean(true);
private final BlockingQueue<SerializedMail> incomingQueue;
private final IntObjectOpenHashMap<ReceiverLookupDocument> lookupMap;
private final IntOpenHashSet receiverOnQueue;
private final int threadNo;
private final MailController mailController;
private final CouchbaseClient client;
private final int maxRetries;
protected MailControllerQueueThread(final MailController mailController, final int threadNo, final CouchbaseClient client, final int maxRetries)
{
super("MailController-thread-" + threadNo);
this.incomingQueue = new LinkedBlockingQueue<SerializedMail>();
this.lookupMap = new IntObjectOpenHashMap<ReceiverLookupDocument>();
this.receiverOnQueue = new IntOpenHashSet();
this.threadNo = threadNo;
this.mailController = mailController;
this.client = client;
this.maxRetries = maxRetries;
}
protected void addMail(final SerializedMail mail)
{
incomingQueue.add(mail);
}
protected void deleteMail(final int receiverID, final String mailKey)
{
incomingQueue.add(new DeleteMail(receiverID, mailKey));
}
protected String getMailKeys(final int receiverID)
{
final ReceiverLookupDocument receiverLookupDocument = getLookup(receiverID);
if (receiverLookupDocument == null)
{
return null;
}
return receiverLookupDocument.toString();
}
protected int size()
{
return incomingQueue.size();
}
protected void shutdown()
{
running.set(false);
incomingQueue.add(new PoisionedSerializedMail());
}
@Override
public void run()
{
while (running.get() || incomingQueue.size() > 0)
{
try
{
final SerializedMail mail = incomingQueue.take();
processMail(mail);
}
catch (InterruptedException e)
{
System.err.println("Could not take mail from queue: " + e.getMessage());
}
}
mailController.countdown();
}
private void processMail(final SerializedMail mail)
{
final int receiverID = mail.getReceiverID();
if (mail instanceof PoisionedSerializedMail)
{
// Do nothing, this mail just unblocks the queue so the thread can shutdown properly
return;
}
else if (mail instanceof PersistLookupDocumentOnly)
{
// Persist lookup document
if (receiverOnQueue.contains(receiverID))
{
if (!persistLookup(receiverID, createLookupDocumentKey(receiverID), lookupMap.get(receiverID)))
{
incomingQueue.add(mail);
}
}
}
else if (mail instanceof DeleteMail)
{
// Delete mail
final ReceiverLookupDocument receiverLookupDocument = getLookup(receiverID);
if (receiverLookupDocument == null || !deleteMail(mail))
{
incomingQueue.add(mail);
}
else
{
removeMailFromReceiverLookupDocument(mail, receiverLookupDocument);
}
}
else
{
// Persist mail
final ReceiverLookupDocument receiverLookupDocument = getLookup(receiverID);
if (receiverLookupDocument == null || !persistMail(mail))
{
incomingQueue.add(mail);
}
else
{
addMailToReceiverLookupDocument(mail, receiverLookupDocument);
}
}
}
private void addMailToReceiverLookupDocument(final SerializedMail mail, final ReceiverLookupDocument receiverLookupDocument)
{
final int receiverID = mail.getReceiverID();
final String lookupDocumentKey = createLookupDocumentKey(receiverID);
// Modify lookup document
if (!receiverLookupDocument.add(mail.getCreated(), mail.getKey()))
{
System.err.println("#" + threadNo + " Could not add mail with same key for mail " + mail.getKey());
return;
}
// Store lookup document
if (!persistLookup(receiverID, lookupDocumentKey, receiverLookupDocument))
{
removeMailFromReceiverLookupDocument(mail, receiverLookupDocument);
}
}
private void removeMailFromReceiverLookupDocument(final SerializedMail mail, final ReceiverLookupDocument receiverLookupDocument)
{
final int receiverID = mail.getReceiverID();
// FIXME UnitTests fail when removing mail from document, check what is happening!
//receiverLookupDocument.remove(mail.getKey());
if (!receiverOnQueue.contains(receiverID))
{
receiverOnQueue.add(receiverID);
incomingQueue.add(new PersistLookupDocumentOnly(receiverID));
}
}
private ReceiverLookupDocument getLookup(final int receiverID)
{
final String lookupDocumentKey = createLookupDocumentKey(receiverID);
ReceiverLookupDocument receiverLookupDocument = lookupMap.get(receiverID);
if (receiverLookupDocument != null)
{
return receiverLookupDocument;
}
int tries = 0;
while (tries++ < maxRetries)
{
try
{
final Object receiverLookupDocumentObject = client.get(lookupDocumentKey);
if (receiverLookupDocumentObject != null)
{
receiverLookupDocument = ReceiverLookupDocument.fromJSON((String)receiverLookupDocumentObject);
}
else
{
receiverLookupDocument = new ReceiverLookupDocument();
}
lookupMap.put(receiverID, receiverLookupDocument);
return receiverLookupDocument;
}
catch (Exception e)
{
System.err.println("#" + threadNo + " Could not read lookup document for " + receiverID + ": " + e.getMessage());
threadSleep(tries * RETRY_DELAY);
}
}
return null;
}
private boolean persistLookup(final int receiverID, final String lookupDocumentKey, final ReceiverLookupDocument receiverLookupDocument)
{
final String document = receiverLookupDocument.toJSON();
int tries = 0;
while (tries++ < maxRetries)
{
try
{
OperationFuture<Boolean> lookupFuture = client.set(lookupDocumentKey, 0, document);
if (lookupFuture.get())
{
receiverOnQueue.remove(receiverID);
printStatusMessage("#" + threadNo + " Lookup document for receiver " + receiverID + " successfully saved", receiverLookupDocument);
mailController.incrementLookupPersisted();
return true;
}
}
catch (Exception e)
{
receiverLookupDocument.setLastException(e);
System.err.println("#" + threadNo + " Could not set lookup document for receiver " + receiverID + ": " + e.getMessage());
threadSleep(tries * RETRY_DELAY);
}
}
mailController.incrementLookupRetries();
receiverLookupDocument.incrementTries();
threadSleep(RETRY_DELAY);
return false;
}
private boolean persistMail(final SerializedMail mail)
{
final String mailKey = createMailDocumentKey(mail.getKey());
int tries = 0;
while (tries++ < maxRetries)
{
try
{
OperationFuture<Boolean> mailFuture = client.set(mailKey, 0, mail.getDocument());
if (mailFuture.get())
{
printStatusMessage("#" + threadNo + " Mail " + mailKey + " successfully saved", mail);
mailController.incrementMailPersisted();
return true;
}
}
catch (Exception e)
{
mail.setLastException(e);
System.err.println("#" + threadNo + " Could not add " + mailKey + " for receiver " + mail.getReceiverID() + ": " + e.getMessage());
threadSleep(tries * RETRY_DELAY);
}
}
mailController.incrementMailRetries();
mail.incrementTries();
threadSleep(RETRY_DELAY);
return false;
}
private boolean deleteMail(final SerializedMail mail)
{
// TODO implement delete funtionality
return false;
}
private String createMailDocumentKey(final String mailKey)
{
return "mail_" + mailKey;
}
private String createLookupDocumentKey(final int receiverID)
{
return "receiver_" + receiverID;
}
private void printStatusMessage(String statusMessage, final StatusMessageObject statusMessageObject)
{
Boolean showMessage = false;
if (statusMessageObject.getTries() > 0)
{
statusMessage += ", Tries: " + statusMessageObject.getTries();
showMessage = true;
}
if (statusMessageObject.getLastException() != null)
{
statusMessage += ", Last Exception: " + statusMessageObject.getLastException().getMessage();
showMessage = true;
}
if (showMessage)
{
System.out.println(statusMessage);
}
statusMessageObject.resetStatus();
}
private void threadSleep(final long milliseconds)
{
try
{
Thread.sleep(milliseconds);
}
catch (InterruptedException e)
{
}
}
private class PoisionedSerializedMail extends SerializedMail
{
public PoisionedSerializedMail()
{
super(0, 0, null, null);
}
}
private class PersistLookupDocumentOnly extends SerializedMail
{
public PersistLookupDocumentOnly(final int receiverID)
{
super(receiverID, 0, null, null);
}
}
private class DeleteMail extends SerializedMail
{
public DeleteMail(final int receiverID, final String mailKey)
{
super(receiverID, 0, mailKey, null);
}
}
}
|
package com.weixin.dto.message.resp;
import com.weixin.dto.message.Music;
/**
* 音乐消息
* Created by White on 2017/2/20.
*/
public class RespMusicMessage extends RespBaseMessage {
private Music Music;
public Music getMusic() {
return Music;
}
public void setMusic(Music music) {
Music = music;
}
}
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
/**
* масив факультеттів
*/
private static Faculty faculties[] = new Faculty[0];
public static void main(String[] args) {
boolean end = false;
while(!end)
{
try {
String str = getString(">");
if(errorCheck(dellEmpty(str.split(" ")), 0))
continue;
String com = dellEmpty(str.split(" "))[0];
switch(com)
{
case "help":
help();
break;
case "add":
add(str);
break;
case "dell":
dell(str);
break;
case "edit":
edit(str);
break;
case "print":
print(str);
break;
case "printF":
printF(str);
break;
case "appoint":
appoint(str);
break;
case "exit":
end = true;
System.out.println("Exit");
break;
default:
System.out.println("Error");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* Метод що вивиодить інструкцію до проограми
*/
private static void help()
{
System.out.println("add - команда створення");
System.out.println("Спосіб використання: add [/O] [назва/ID] [/R] [курс]");
System.out.println("/O - обєкт(faculty, department, student, teacher, group)");
System.out.println("/R - шлях([faculty]/[department]");
System.out.println();
System.out.println("del - команда видалення");
System.out.println("Спосіб використання: del [/O] [назва/ID] [/R]");
System.out.println("/O - обєкт(faculty, department, student, teacher, group)");
System.out.println("/R - шлях([faculty]/[department]");
System.out.println();
System.out.println("edit - команда редагування");
System.out.println("Спосіб використання: edit [/O] [назва/ID] [/R] [нова назва/ID] [новий курс]");
System.out.println("/O - обєкт(faculty, department, student, teacher, group)");
System.out.println("/R - шлях([faculty]/[department]");
System.out.println();
System.out.println("print - команда виводу інформації");
System.out.println("Спосіб використання: print [/O] [назва/ID] [/R] [/S]");
System.out.println("/O - обєкт(faculty, department, student, teacher, group, course)");
System.out.println("/R - шлях([faculty]/[department]");
System.out.println("/S - сортувати за(name, course)");
System.out.println();
System.out.println("printF - команда що виводить студентів і вчителів незалежно від кафедр");
System.out.println("printF [назва факультету] [/O] [/S]");
System.out.println("/O - обєкт(student, teacher)");
System.out.println("/S - сортувати за(name, course)");
System.out.println();
System.out.println("appoint - команда назначення студентів та викладачів до групи");
System.out.println("Повторне назначення видаляє з групи, а викладачі переназначаються");
System.out.println("appoint [/O] [назва] [/R] [ID]");
System.out.println("/R - шлях([faculty]/[department]");
System.out.println("/O - обєкт(student, teacher)");
}
/**
* Метод що створює нові обєкти
* @param str рядок що був ведений користувачем
*/
private static void add(String str)
{
String com[] = dellEmpty(str.split(" "));
if(errorCheck(com, 1))
return;
switch(com[1])
{
case "faculty":
if(errorCheck(com, 2))
break;
if(com.length > 3)
{
System.out.println("Error");
break;
}
if(isExist(com[2]))
{
System.out.println("Error");
break;
}
System.out.println("Success");
addFaculty(new Faculty(com[2]));
break;
case "department":
if(errorCheck(com, 3))
break;
if(isExist(com[3]))
{
if(facultyByName(com[3]).isExist(com[2]))
System.out.println("Error");
else
{
System.out.println("Success");
facultyByName(com[3]).addDepartment(new Department(com[2]));
}
}
else
System.out.println("Error");
break;
case "student":
if(errorCheck(com, 4))
break;
String roadS[] = com[3].split("/");
if(errorCheck(roadS, 1))
break;
if(isExist(roadS[0]))
{
if(facultyByName(roadS[0]).isExist(roadS[1]))
{
if(facultyByName(roadS[0]).departmentByName(roadS[1]).studentIsExist(com[2]))
System.out.println("Error");
else
{
try
{
int course = Integer.valueOf(com[4]);
System.out.println("Success");
facultyByName(roadS[0]).departmentByName(roadS[1]).addStudent(new Student(com[2], course));
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "teacher":
if(errorCheck(com, 3))
break;
String roadT[] = com[3].split("/");
if(errorCheck(roadT, 1))
break;
if(isExist(roadT[0]))
{
if(facultyByName(roadT[0]).isExist(roadT[1]))
{
if(facultyByName(roadT[0]).departmentByName(roadT[1]).teacherIsExist(com[2]))
System.out.println("Error");
else
{
System.out.println("Success");
facultyByName(roadT[0]).departmentByName(roadT[1]).addTeacher(new Teacher(com[2]));
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "group":
if(errorCheck(com, 3))
break;
String roadG[] = com[3].split("/");
if(errorCheck(roadG, 1))
break;
if(isExist(roadG[0]))
{
if(facultyByName(roadG[0]).isExist(roadG[1]))
{
try
{
int id = Integer.valueOf(com[2]);
if(facultyByName(roadG[0]).departmentByName(roadG[1]).groupIsExist(id))
System.out.println("Error");
else
{
System.out.println("Success");
facultyByName(roadG[0]).departmentByName(roadG[1]).addGroup(new Group(id));
}
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
default:
System.out.println("Error");
return;
}
}
/**
* Метод що видаляє обєкти
* @param str рядок що був ведений користувачем
*/
private static void dell(String str)
{
String com[] = dellEmpty(str.split(" "));
if(errorCheck(com, 1))
return;
switch(com[1])
{
case "faculty":
if(errorCheck(com, 2))
break;
if(com.length > 3)
{
System.out.println("Error");
break;
}
if(isExist(com[2]))
{
deleteFacultyByName(com[2]);
System.out.println("Success");
}
else
System.out.println("Error");
break;
case "department":
if(errorCheck(com, 3))
break;
if(com.length > 4)
{
System.out.println("Error");
break;
}
if(isExist(com[3]))
{
if(facultyByName(com[3]).isExist(com[2]))
{
System.out.println("Success");
facultyByName(com[3]).deleteDepartmentByName(com[2]);
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "student":
if(errorCheck(com, 3))
break;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadS[] = com[3].split("/");
if(errorCheck(roadS, 1))
break;
if(isExist(roadS[0]))
{
if(facultyByName(roadS[0]).isExist(roadS[1]))
{
if(facultyByName(roadS[0]).departmentByName(roadS[1]).studentIsExist(com[2]))
{
System.out.println("Success");
facultyByName(roadS[0]).departmentByName(roadS[1]).deleteStudentByName(com[2]);;
}
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "teacher":
if(errorCheck(com, 3))
break;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadT[] = com[3].split("/");
if(errorCheck(roadT, 1))
break;
if(isExist(roadT[0]))
{
if(facultyByName(roadT[0]).isExist(roadT[1]))
{
if(facultyByName(roadT[0]).departmentByName(roadT[1]).teacherIsExist(com[2]))
{
System.out.println("Success");
facultyByName(roadT[0]).departmentByName(roadT[1]).deleteTeacherByName(com[2]);;
}
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "group":
if(errorCheck(com, 3))
break;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadG[] = com[3].split("/");
if(errorCheck(roadG, 1))
break;
if(isExist(roadG[0]))
{
if(facultyByName(roadG[0]).isExist(roadG[1]))
{
try
{
int id = Integer.valueOf(com[2]);
if(facultyByName(roadG[0]).departmentByName(roadG[1]).groupIsExist(id))
{
System.out.println("Success");
facultyByName(roadG[0]).departmentByName(roadG[1]).deleteGroupByID(id);
}
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
default:
System.out.println("Error");
return;
}
}
/**
* метод що редагує обєкти
* @param str рядок що був ведений користувачем
*/
private static void edit(String str)
{
String com[] = dellEmpty(str.split(" "));
if(errorCheck(com, 1))
return;
switch(com[1])
{
case "faculty":
if(errorCheck(com, 3))
break;
if(com.length > 4)
{
System.out.println("Error");
break;
}
if(isExist(com[2]))
{
facultyByName(com[2]).setName(com[3]);
System.out.println("Success");
}
else
System.out.println("Error");
break;
case "department":
if(errorCheck(com, 4))
break;
if(com.length > 5)
{
System.out.println("Error");
break;
}
if(isExist(com[3]))
{
if(facultyByName(com[3]).isExist(com[2]))
{
System.out.println("Success");
facultyByName(com[3]).departmentByName(com[2]).setName(com[4]);
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "student":
if(errorCheck(com, 5))
break;
if(com.length > 6)
{
System.out.println("Error");
break;
}
String roadS[] = com[3].split("/");
if(errorCheck(roadS, 1))
break;
if(isExist(roadS[0]))
{
if(facultyByName(roadS[0]).isExist(roadS[1]))
{
if(facultyByName(roadS[0]).departmentByName(roadS[1]).studentIsExist(com[2]))
{
System.out.println("Success");
facultyByName(roadS[0]).departmentByName(roadS[1]).studentByName(com[2]).setName(com[4]);
try
{
int course = Integer.valueOf(com[5]);
System.out.println("Success");
facultyByName(roadS[0]).departmentByName(roadS[1]).studentByName(com[4]).setCourse(course);
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "teacher":
if(errorCheck(com, 4))
break;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadT[] = com[3].split("/");
if(errorCheck(roadT, 1))
break;
if(isExist(roadT[0]))
{
if(facultyByName(roadT[0]).isExist(roadT[1]))
{
if(facultyByName(roadT[0]).departmentByName(roadT[1]).teacherIsExist(com[2]))
{
System.out.println("Success");
facultyByName(roadT[0]).departmentByName(roadT[1]).teacherByName(com[2]).setName(com[4]);
}
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "group":
if(errorCheck(com, 4))
break;
if(com.length > 5)
{
System.out.println("Error");
break;
}
String roadG[] = com[3].split("/");
if(errorCheck(roadG, 1))
break;
if(isExist(roadG[0]))
{
if(facultyByName(roadG[0]).isExist(roadG[1]))
{
try
{
int id1 = Integer.valueOf(com[2]);
int id2 = Integer.valueOf(com[4]);
if(facultyByName(roadG[0]).departmentByName(roadG[1]).groupIsExist(id1))
{
System.out.println("Success");
facultyByName(roadG[0]).departmentByName(roadG[1]).groupByID(id1).setID(id2);;
}
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
default:
System.out.println("Error");
return;
}
}
/**
* метод що виводить інформацію про обєкти
* @param str рядок що був ведений користувачем
*/
private static void print(String str)
{
String com[] = dellEmpty(str.split(" "));
if(errorCheck(com, 1))
return;
switch(com[1])
{
case "faculty":
if(errorCheck(com, 2))
return;
if(com.length > 4)
{
System.out.println("Error");
break;
}
if(isExist(com[2]))
{
if(com.length > 3)
{
if(com[3].equalsIgnoreCase("name"))
System.out.println(facultyByName(com[2]).sortedDepartments());
else
System.out.println("Error");
}
else
System.out.println(facultyByName(com[2]));
}
else
System.out.println("Error");
break;
case "department":
if(errorCheck(com, 3))
return;
if(com.length > 5)
{
System.out.println("Error");
break;
}
if(isExist(com[3]))
{
if(facultyByName(com[3]).isExist(com[2]))
{
if(com.length > 4)
{
if(com[4].equalsIgnoreCase("name"))
System.out.println(facultyByName(com[3]).departmentByName(com[2]).sortedByName());
else if(com[4].equalsIgnoreCase("course"))
System.out.println(facultyByName(com[3]).departmentByName(com[2]).sortedByCourse());
else
System.out.println("Error");
}
else
System.out.println(facultyByName(com[3]).departmentByName(com[2]));
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "student":
if(errorCheck(com, 3))
return;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadS[] = com[3].split("/");
if(errorCheck(roadS, 1))
break;
if(isExist(roadS[0]))
{
if(facultyByName(roadS[0]).isExist(roadS[1]))
{
if(facultyByName(roadS[0]).departmentByName(roadS[1]).studentIsExist(com[2]))
System.out.println(facultyByName(roadS[0]).departmentByName(roadS[1]).studentByName(com[2]));
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "teacher":
if(errorCheck(com, 3))
return;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadT[] = com[3].split("/");
if(errorCheck(roadT, 1))
break;
if(isExist(roadT[0]))
{
if(facultyByName(roadT[0]).isExist(roadT[1]))
{
if(facultyByName(roadT[0]).departmentByName(roadT[1]).teacherIsExist(com[2]))
System.out.println(facultyByName(roadT[0]).departmentByName(roadT[1]).teacherByName(com[2]));
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "group":
if(errorCheck(com, 3))
return;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadG[] = com[3].split("/");
if(errorCheck(roadG, 1))
break;
if(isExist(roadG[0]))
{
if(facultyByName(roadG[0]).isExist(roadG[1]))
{
try
{
int id = Integer.valueOf(com[2]);
if(facultyByName(roadG[0]).departmentByName(roadG[1]).groupIsExist(id))
System.out.println(facultyByName(roadG[0]).departmentByName(roadG[1]).groupByID(id));
else
System.out.println("Error");
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "course":
if(errorCheck(com, 3))
return;
if(com.length > 4)
{
System.out.println("Error");
break;
}
String roadC[] = com[3].split("/");
if(roadC.length == 1)
{
if(isExist(com[3]))
{
try
{
int course = Integer.valueOf(com[2]);
System.out.println(facultyByName(com[3]).studentsByCourse(course));
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else if(roadC.length == 2)
{
if(isExist(roadC[0]))
{
if(facultyByName(roadC[0]).isExist(roadC[0]))
{
try
{
int course = Integer.valueOf(com[2]);
System.out.println(facultyByName(com[3]).studentsByCourse(course));
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
default:
System.out.println("Error");
return;
}
}
/**
* Метод що виводить студентів або вчителів не відносячи їх до кафедр
* @param str рядок що був ведений користувачем
*/
private static void printF(String str)
{
String com[] = dellEmpty(str.split(" "));
if(errorCheck(com, 2))
return;
if(com.length > 4)
{
System.out.println("Error");
return;
}
if(isExist(com[1]))
{
switch(com[2])
{
case "student":
if(com.length > 3)
{
switch(com[3])
{
case "name":
System.out.println(facultyByName(com[1]).sortedStudentsByName());
break;
case "course":
System.out.println(facultyByName(com[1]).sortedStudentsByCourse());
break;
default:
break;
}
}
else
System.out.println(facultyByName(com[1]).students());
break;
case "teacher":
if(com.length > 3)
{
if(com[3].equalsIgnoreCase("name"))
System.out.println(facultyByName(com[1]).sortedTeachersByName());
else
System.out.println("Error");
}
else
System.out.println(facultyByName(com[1]).teachers());
break;
default:
System.out.println("Error");
break;
}
}
else
System.out.println("Error");
}
/**
* Метод що назначає студентів і вчителів до груп
* @param str рядок що був ведений користувачем
*/
private static void appoint(String str)
{
String com[] = dellEmpty(str.split(" "));
if(errorCheck(com, 1))
return;
switch(com[1])
{
case "student":
if(errorCheck(com, 4))
return;
if(com.length > 5)
{
System.out.println("Error");
break;
}
String roadS[] = com[3].split("/");
if(errorCheck(roadS, 1))
break;
if(isExist(roadS[0]))
{
if(facultyByName(roadS[0]).isExist(roadS[1]))
{
if(facultyByName(roadS[0]).departmentByName(roadS[1]).studentIsExist(com[2]))
{
try
{
int id = Integer.valueOf(com[4]);
if(facultyByName(roadS[0]).departmentByName(roadS[1]).groupIsExist(id))
{
facultyByName(roadS[0]).departmentByName(roadS[1]).
groupByID(id).addStudent(facultyByName(roadS[0]).
departmentByName(roadS[1]).studentByName(com[2]));
}
else
System.out.println("Error");
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
case "teacher":
if(errorCheck(com, 4))
return;
if(com.length > 5)
{
System.out.println("Error");
break;
}
String roadT[] = com[3].split("/");
if(errorCheck(roadT, 1))
break;
if(isExist(roadT[0]))
{
if(facultyByName(roadT[0]).isExist(roadT[1]))
{
if(facultyByName(roadT[0]).departmentByName(roadT[1]).teacherIsExist(com[2]))
{
try
{
int id = Integer.valueOf(com[4]);
if(facultyByName(roadT[0]).departmentByName(roadT[1]).groupIsExist(id))
{
facultyByName(roadT[0]).departmentByName(roadT[1]).
groupByID(id).setTeacher(facultyByName(roadT[0]).
departmentByName(roadT[1]).teacherByName(com[2]));
}
else
System.out.println("Error");
}
catch(NumberFormatException e)
{
System.out.println("Error");
}
}
else
System.out.println("Error");
}
else
System.out.println("Error");
}
else
System.out.println("Error");
break;
default:
System.out.println("Error");
return;
}
}
/**
* Метод що видаляє непотрібні комірки в масиві
* @param str масив з робитими словами що були введені користувачем
* @return масив без непотрібних комірок
*/
private static String[] dellEmpty(String[] str)
{
String newStr[] = new String[str.length];
int count = 0;
for(int i = 0; i < str.length; i++)
{
if(str[i].equalsIgnoreCase("") || str[i] == null)
{
newStr = reduceArr(newStr);
count++;
}
else
newStr[i-count] = str[i];
}
return str;
}
/**
* Метод що зменшує масив на один забираючи кінцеву комірку
* @param str масив рядків
* @return масив рядків без останьої комірки
*/
private static String[] reduceArr(String[] str)
{
String newStr[] = new String[str.length-1];
for(int i = 0; i < newStr.length; i++)
newStr[i] = str[i];
return newStr;
}
/**
* Метод що зчитує введений користувачем рядок
* @return рядок введений користувачем
* @throws IOException
*/
private static String getString() throws IOException{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s = br.readLine();
return s;
}
/**
* Метод що зчитує введений користувачем рядок
* @param wr рядок що виведеться перед тим як користувач введе
* @return рядок введений користувачем
* @throws IOException
*/
private static String getString(String wr) throws IOException{
System.out.print(wr);
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s = br.readLine();
return s;
}
/**
* Метод що перевіряє чи достатньо довгий масив
* @param com масив
* @param i число за яке має бути більший масив
* @return true - якщо менший false - якщо більший
*/
private static boolean errorCheck(String[] com, int i)
{
if(com.length-1 >= i)
{
return false;
}
else
{
System.out.println("Error");
return true;
}
}
/**
* Метод що додає до масиву факультетів ще один
* @param f факультет що потрібно додати
*/
private static void addFaculty(Faculty f)
{
Faculty newFac[] = new Faculty[faculties.length+1];
for(int i = 0; i < faculties.length; i++)
newFac[i] = faculties[i];
newFac[faculties.length] = f;
faculties = newFac;
}
/**
* Метод що перевіряє чи існує факультет з заданим іменем
* @param name імя факультету
* @return true - якщо існує false - якщо не існує
*/
private static boolean isExist(String name)
{
for(int i = 0; i < faculties.length; i++)
if(faculties[i].getName().equalsIgnoreCase(name))
return true;
return false;
}
/**
* Метод що повертає факультет за його іменем
* @param name імя факультету
* @return факультет під вказним іменем
*/
private static Faculty facultyByName(String name)
{
for(int i = 0; i < faculties.length; i++)
if(faculties[i].getName().equalsIgnoreCase(name))
return faculties[i];
return null;
}
/**
* Метод що видаляє факультет за його іменем
* @param name імя факультет
*/
private static void deleteFacultyByName(String name)
{
int index = -1;
for(int i = 0; i < faculties.length; i++)
{
if(faculties[i].getName().equalsIgnoreCase(name))
{
index = i;
break;
}
}
if(index < 0)
return;
else
{
Faculty newFac[] = new Faculty[faculties.length-1];
for(int i = 0; i < faculties.length; i++)
{
if(i == index)
continue;
else if(index > i)
newFac[i] = faculties[i];
else
newFac[i-1] = faculties[i];
}
faculties = newFac;
}
}
}
|
package com.tencent.mm.plugin.card.model;
import com.tencent.mars.smc.IDKey;
import com.tencent.mm.ab.b;
import com.tencent.mm.ab.b.a;
import com.tencent.mm.ab.e;
import com.tencent.mm.ab.l;
import com.tencent.mm.kernel.g;
import com.tencent.mm.network.k;
import com.tencent.mm.network.q;
import com.tencent.mm.plugin.card.d.j;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.plugin.sns.i$l;
import com.tencent.mm.protocal.c.abr;
import com.tencent.mm.protocal.c.abs;
import com.tencent.mm.protocal.c.abv;
import com.tencent.mm.protocal.c.ma;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.storage.aa;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public final class ad extends l implements k {
private final b diG;
private e diJ;
public boolean hxk = false;
public ad(double d, double d2, int i) {
a aVar = new a();
aVar.dIG = new abr();
aVar.dIH = new abs();
aVar.uri = "/cgi-bin/micromsg-bin/getcardslayout";
aVar.dIF = 984;
aVar.dII = 0;
aVar.dIJ = 0;
this.diG = aVar.KT();
abr abr = (abr) this.diG.dID.dIL;
abr.latitude = d;
abr.longitude = d2;
abr.scene = i;
abr.rGo = (String) g.Ei().DT().get(aa.a.sPR, null);
}
public final void a(int i, int i2, int i3, String str, q qVar, byte[] bArr) {
x.i("MicroMsg.NetSceneGetCardsLayout", "onGYNetEnd, errType = %d, errCode = %d", new Object[]{Integer.valueOf(i2), Integer.valueOf(i3)});
abs abs = (abs) this.diG.dIE.dIL;
x.v("MicroMsg.NetSceneGetCardsLayout", "json:" + abs.hwU);
if (i2 == 0 && i3 == 0) {
boolean z;
g.Ei().DT().a(aa.a.sPR, abs.rGo);
String str2 = abs.hwU;
long currentTimeMillis = System.currentTimeMillis();
String str3 = (String) g.Ei().DT().get(aa.a.sPQ, null);
if (!bi.oW(str3)) {
str2 = str3;
}
abv xU = j.xU(str2);
am.axi().diF.fV("UserCardInfo", "update UserCardInfo set stickyIndex=0, stickyEndTime=0 , label_wording='' where stickyIndex>0");
if (xU == null) {
x.w("MicroMsg.CardStickyHelper", "[doUpdateStickyInfoLogic] resp null");
z = false;
} else {
int i4;
z = false;
if (xU.rGr != null) {
ma maVar = xU.rGr;
Map hashMap = new HashMap();
hashMap.put("expiring_list", Integer.valueOf(2));
hashMap.put("member_card_list", Integer.valueOf(2));
hashMap.put("nearby_list", Integer.valueOf(3));
hashMap.put("first_list", Integer.valueOf(5));
if (xU.rGu == 100) {
hashMap.put("expiring_list", Integer.valueOf(4));
} else if (xU.rGu == i$l.AppCompatTheme_checkboxStyle) {
hashMap.put("member_card_list", Integer.valueOf(4));
} else if (xU.rGu == i$l.AppCompatTheme_buttonStyleSmall) {
hashMap.put("nearby_list", Integer.valueOf(4));
}
long dO = g.Ei().dqq.dO(Thread.currentThread().getId());
if (xU.rGr.rqj == null || xU.rGr.rqj.rqi == null || xU.rGr.rqj.rqi.size() <= 0) {
i4 = 0;
} else {
z = true;
j.b(xU.rGr.rqj.rqi, (((Integer) hashMap.get("expiring_list")).intValue() * 100000) + 3);
i4 = xU.rGr.rqj.rqi.size() + 0;
}
if (!(xU.rGr.rqk == null || xU.rGr.rqk.rqi == null || xU.rGr.rqk.rqi.size() <= 0)) {
z = true;
j.b(xU.rGr.rqk.rqi, (((Integer) hashMap.get("member_card_list")).intValue() * 100000) + 2);
i4 += xU.rGr.rqk.rqi.size();
}
if (!(xU.rGr.rql == null || xU.rGr.rql.rqi == null || xU.rGr.rql.rqi.size() <= 0)) {
z = true;
j.b(xU.rGr.rql.rqi, (((Integer) hashMap.get("nearby_list")).intValue() * 100000) + 1);
i4 += xU.rGr.rql.rqi.size();
}
if (!(xU.rGr.rqm == null || xU.rGr.rqm.rqi == null || xU.rGr.rqm.rqi.size() <= 0)) {
z = true;
i4 += xU.rGr.rqm.rqi.size();
j.c(xU.rGr.rqm.rqi, 0);
}
if (!(xU.rGr.rqn == null || xU.rGr.rqn.rqi == null || xU.rGr.rqn.rqi.size() <= 0)) {
z = true;
int intValue = (((Integer) hashMap.get("first_list")).intValue() * 100000) + 4;
j.b(xU.rGr.rqn.rqi, intValue);
j.c(xU.rGr.rqn.rqi, intValue);
i4 += xU.rGr.rqn.rqi.size();
}
g.Ei().dqq.gp(dO);
} else {
i4 = 0;
}
am.axn().putValue("key_get_card_layout_resp", xU);
g.Ei().DT().a(aa.a.sPZ, str2);
if (i4 > 0) {
long currentTimeMillis2 = System.currentTimeMillis();
ArrayList arrayList = new ArrayList();
IDKey iDKey = new IDKey();
iDKey.SetID(281);
iDKey.SetKey(36);
iDKey.SetValue(1);
IDKey iDKey2 = new IDKey();
iDKey2.SetID(281);
iDKey2.SetKey(37);
iDKey2.SetValue((long) ((int) (currentTimeMillis2 - currentTimeMillis)));
IDKey iDKey3 = new IDKey();
iDKey3.SetID(281);
iDKey3.SetKey(38);
iDKey3.SetValue((long) i4);
IDKey iDKey4 = new IDKey();
iDKey4.SetID(281);
iDKey4.SetKey(40);
iDKey4.SetValue((long) (((int) (currentTimeMillis2 - currentTimeMillis)) / i4));
arrayList.add(iDKey);
arrayList.add(iDKey2);
arrayList.add(iDKey3);
arrayList.add(iDKey4);
h.mEJ.b(arrayList, true);
}
}
this.hxk = z;
}
this.diJ.a(i2, i3, str, this);
}
public final int getType() {
return 984;
}
public final int a(com.tencent.mm.network.e eVar, e eVar2) {
this.diJ = eVar2;
return a(eVar, this.diG, this);
}
}
|
package interno.nucleo;
/* MAESTRO VIPERD (multi-plataforma)
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
import java.text.SimpleDateFormat;
import java.util.Date;
public class Funciones {
public static String reemplazarTexto(String cadena, String buscar, String reemplazar) {
StringBuilder sb = null;
int start = 0;
for (int i; (i = cadena.indexOf(buscar, start)) != -1;) {
if (sb == null) {
sb = new StringBuilder();
}
sb.append(cadena, start, i);
sb.append(reemplazar);
start = i + buscar.length();
}
if (sb == null) {
return cadena;
}
sb.append(cadena, start, cadena.length());
return sb.toString();
}
public static String reemplazarComillas(String cadena) {
if (cadena.contains("'")) {
StringBuilder sb = null;
int start = 0;
for (int i; (i = cadena.indexOf("'", start)) != -1;) {
if (sb == null) {
sb = new StringBuilder();
}
sb.append(cadena, start, i);
sb.append("''");
start = i + 1;
}
if (sb == null) {
return cadena;
} else {
sb.append(cadena, start, cadena.length());
return sb.toString();
}
} else {
return cadena;
}
}
public static String unirTextos(String[] lista, String separador) {
StringBuilder str = new StringBuilder();
for (int i = 0, largo = lista.length; i < largo; i++) {
if (lista[i] != null) {
if (i > 0) {
str.append(separador);
}
str.append(lista[i]);
}
}
return str.toString();
}
public static String textoNoNulo(String valor) {
String cadena = "";
if (valor != null) {
cadena = valor;
}
if (cadena.equalsIgnoreCase("null")) {
cadena = "";
}
return cadena;
}
public static String convertirFechaHora(String valor, String ini, String fin) {
String resultado = valor;
SimpleDateFormat df;
SimpleDateFormat di;
Date fe;
try {
if (valor.equalsIgnoreCase("ahora")) {
df = new SimpleDateFormat(fin);
resultado = df.format(new Date());
} else if (valor.length() > 0) {
di = new SimpleDateFormat(ini);
df = new SimpleDateFormat(fin);
fe = di.parse(valor);
resultado = df.format(fe);
}
} catch (Exception e) {}
return resultado;
}
public static Integer enteroNoNulo(String valor) {
Integer numero = 0;
if (valor.length() > 0) {
for (int i = 0; i < valor.length(); i++) {
if (!Character.isDigit(valor.charAt(i))) {
return numero;
}
}
try {
numero = Integer.parseInt(valor);
} catch (Exception e) {}
}
return numero;
}
}
|
package com.example.billage.backend.common;
import android.database.sqlite.SQLiteDatabase;
import android.provider.BaseColumns;
public class Databases {
public static SQLiteDatabase mDB;
public static final class CreateDB implements BaseColumns {
public static final String NAME = "name";
public static final String TIME = "time";
public static final String DATE = "date";
public static final String MONEY = "money";
public static final String INOUT = "inout";
public static final String MEMO = "memo";
public static final String BANK_CODE = "bank_code";
public static final String ID = "id";
public static final String TYPE = "type";
public static final String _TABLENAME0 = "'transaction'";
public static final String _CREATE0 = "CREATE TABLE IF NOT EXISTS "+_TABLENAME0+" (" +
NAME + " TEXT NOT NULL," +
DATE + " TEXT NOT NULL," +
TIME + " TEXT NOT NULL," +
INOUT + " TEXT NOT NULL," +
MONEY + " TEXT NOT NULL," +
BANK_CODE + " TEXT NOT NULL," +
MEMO + " TEXT,"+
TYPE + " TEXT NOT NULL,"+
ID + " INTEGER PRIMARY KEY AUTOINCREMENT" + ")";
}
}
|
package com.codriver;
import com.facebook.react.ReactActivity;
import android.os.Bundle;
public class MainActivity extends ReactActivity {
/**
* We override onCreate method to discard any Activity state persisted during Activity restart process.
* Please find more information at: https://github.com/software-mansion/react-native-screens#android
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "Codriver";
}
}
|
package com.example.android.giphyapi.activity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.FrameLayout;
import com.example.android.giphyapi.R;
import com.example.android.giphyapi.fragments.AboutFragment;
import com.example.android.giphyapi.fragments.RecentFragment;
import com.example.android.giphyapi.fragments.SearchFragment;
import com.example.android.giphyapi.fragments.TrendingFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MainActivity extends AppCompatActivity {
private SearchFragment searchFragment = new SearchFragment();
private AboutFragment aboutFragment = new AboutFragment();
private TrendingFragment trendingFragment = new TrendingFragment();
private RecentFragment recentFragment = new RecentFragment();
@BindView(R.id.bottom_nav)
BottomNavigationView bottomNavigationView;
@BindView(R.id.my_toolbar)
Toolbar giphyOptionsToolbar;
@BindView(R.id.fragment_container)
FrameLayout fragmentContainer;
private Menu menuOptions;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
giphyOptionsToolbar.setTitleTextColor(getColor(R.color.white));
setSupportActionBar(giphyOptionsToolbar);
AboutFragment.newInstance();
SearchFragment.newInstance();
TrendingFragment.newInstance();
RecentFragment.newInstance();
initBottomNavigation();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menuOptions = menu;
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
menu.findItem(R.id.action_share).getIcon().setTint(getColor(R.color.white));
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_share:
Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
if (currentFragment instanceof ShareableFragment) {
((ShareableFragment) currentFragment).shareGif();
}
break;
}
return super.onOptionsItemSelected(item);
}
private void initBottomNavigation() {
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
int position = 0;
@Override
public boolean onNavigationItemSelected( @NonNull MenuItem item ) {
switch (item.getItemId()) {
case R.id.action_search:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, searchFragment).commit();
position = 0;
break;
case R.id.action_trending:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, trendingFragment).commit();
position = 1;
break;
case R.id.action_recent:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, recentFragment).commit();
position = 2;
break;
case R.id.action_about:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, aboutFragment).commit();
position = 3;
break;
}
MenuItem shareMenuItem = menuOptions.findItem(R.id.action_share);
if (position == 2 || position == 3 ) {
shareMenuItem.setVisible(false);
} else {
shareMenuItem.setVisible(true);
}
return true;
}
});
}
@Override
protected void onResume() {
super.onResume();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.